kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

multi-stage dockerfile build issue in kaniko debug image

Open winty56 opened this issue 1 year ago • 2 comments

Actual behavior I use kaniko in gitlab-ci by the following guide In windows docker-desktop it run well. (windows10. docker-desktop v4.25.0, docker version 24.0.6) but when I try to test on Ubuntu machine to move gitlab-runner, the build fails with the error message error building image: deleting file system after stage 0: unlinkat //bin: invalid argument.

I don't know why this happens.

Expected behavior Kaniko should build multi-stage dockerfile image successfully in kaniko debug docker image container

To Reproduce Steps to reproduce the behavior:

  1. run kaniko debug docker image
    docker run --rm -it --entrypoint /bin/sh gcr.io/kaniko-project/executor:v1.18.0-debug
    
  2. create dockerfile like below additional information in /workspace/test directory
  3. run docker build
    /kaniko/executor --context /workspace/test --dockerfile /workspace/test/dockerfile --destination image --no-push --verbosity=debug
    
  4. at last of build msg. it occur error
    DEBU[0033] Adding to layer: []
    DEBU[0033] Deleting in layer: map[]
    INFO[0033] No files were changed, appending empty layer to config. No layer added to image.
    DEBU[0033] Mapping stage idx 0 to digest sha256:e81593ca9d878d06e022be2d79ae53f4bb2aedf2130d0b8b3b030bde1dbf001e
    DEBU[0033] Mapping digest sha256:e81593ca9d878d06e022be2d79ae53f4bb2aedf2130d0b8b3b030bde1dbf001e to cachekey
    INFO[0033] Deleting filesystem...
    error building image: deleting file system after stage 0: unlinkat //bin: invalid argument
    

Additional Information

  • Envionment

    • Docker version 24.0.7, build afdd53b
    • Ubuntu 22.04.3 LTS
  • Dockerfile

    FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
    
    RUN echo 1
    
    FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
    
    RUN echo 2
    
  • Build Context nothing. because build context not needs for error reproduce

  • Kaniko Image (fully qualified with digest)

    gcr.io/kaniko-project/executor:v1.18.0-debug
    sha256:b6a520e10252cfbb1898cac88d05f4c7c838cf615d1a588ec63a0d415db6c4c0
    

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [ ]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

winty56 avatar Nov 22 '23 08:11 winty56