Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-stage dockerfile build issue in kaniko debug image #2864

Open
winty56 opened this issue Nov 22, 2023 · 2 comments
Open

multi-stage dockerfile build issue in kaniko debug image #2864

winty56 opened this issue Nov 22, 2023 · 2 comments
Labels
area/multi-stage builds issues related to kaniko multi-stage builds differs-from-docker kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next.

Comments

@winty56
Copy link

winty56 commented Nov 22, 2023

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
@cmorty
Copy link

cmorty commented Nov 23, 2023

Probaly a dup of #1406 or rather #2835 or one of the others. :(

@QuanZhang-William QuanZhang-William added differs-from-docker priority/p1 Basic need feature compatibility with docker build. we should be working on this next. area/multi-stage builds issues related to kaniko multi-stage builds kind/bug Something isn't working labels Nov 23, 2023
@tomislater
Copy link

I would add that it fails in total random way 🤔 I could not reproduce it yet... it just sometimes fails and sometimes it is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/multi-stage builds issues related to kaniko multi-stage builds differs-from-docker kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next.
Projects
None yet
Development

No branches or pull requests

4 participants