-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Missing symlink in the images built using Kaniko #1944
Comments
Any updates/comments? 🙂 We were on the verge of replacing the dind containers (which builds the images in our CI) with Kaniko, but these deviations from docker image is really disappointing! 🙁 |
Nope. Nobody is currently working on this issue. If you have any ideas about a fix, feel free to send a PR and I'll review it. If you (or anyone) would be interested in meeting over video some time and going through the code, I'd be willing to arrange that. |
I experience somehow the same weird issue. During a huge build, suddenly |
@imjasonh Any idea where the error could be located? Just stumbled over this: |
I think that is super important, to get fixed, since this holds people back from using kaniko... |
I cannot reproduce this error with the current |
I have the following output which shows the problem over two stages INFO[0504] Taking snapshot of full filesystem...
INFO[0513] RUN ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0
INFO[0513] cmd: /bin/sh
INFO[0513] args: [-c ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0]
INFO[0513] util.Lookup returned: &{Uid:1000 Gid:1000 Username:developer Name: HomeDir:/home/developer}
INFO[0513] performing slow lookup of group ids for developer
INFO[0513] Running: [/bin/sh -c ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0]
lrwxrwxrwx 1 root root 16 Aug 8 2019 /usr/lib/x86_64-linux-gnu/libbsd.so.0 -> libbsd.so.0.10.0
INFO[0513] Taking snapshot of full filesystem...
INFO[0515] No files were changed, appending empty layer to config. No layer added to image.
INFO[0515] WORKDIR "/home/$USER_NAME"
INFO[0515] cmd: workdir
INFO[0515] Changed working directory to /home/developer
INFO[0515] No files changed in this command, skipping snapshotting.
INFO[0515] Storing source image from stage 0 at path /kaniko/stages/0
INFO[0532] Deleting filesystem...
----------------------------------- HERE IS THE FIRST STAGE FINISHED (all good)
INFO[0540] Base image from previous stage 0 found, using saved tar at path /kaniko/stages/0
INFO[0540] Executing 0 build triggers
INFO[0543] Unpacking rootfs as cmd RUN ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0 requires it.
INFO[0572] ARG SECRETS_DIR
INFO[0572] ARG BUILD_DIR
INFO[0572] ARG USER_NAME
INFO[0572] ARG PYTHON_ENV
INFO[0572] ARG BUILD_VERSION
INFO[0572] ENV CONTAINER_BUILD_VERSION=$BUILD_VERSION
INFO[0572] RUN ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0
INFO[0572] Taking snapshot of full filesystem...
INFO[0580] cmd: /bin/sh
INFO[0580] args: [-c ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0]
INFO[0580] util.Lookup returned: &{Uid:1000 Gid:1000 Username:developer Name: HomeDir:/home/developer}
INFO[0580] performing slow lookup of group ids for developer
INFO[0580] Running: [/bin/sh -c ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0]
ls: cannot access '/usr/lib/x86_64-linux-gnu/libbsd.so.0': No such file or directory
----------------------------------- Now suddenly the symlink is missing. It seems that the next initial state does not unpack symlinks properly (???) ### FIRST STAGE
FROM ... as AAAA
RUN ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0
WORKDIR "/home/$USER_NAME"
### SECOND STAGE *until here all good*
FROM AAAA as BBBB
ARG SECRETS_DIR
ARG BUILD_DIR
ARG USER_NAME
ARG PYTHON_ENV
ENV CONTAINER_ID="7fff7106-af66-4e23-bba8-2278408b982c""
RUN ls -al /usr/lib/x86_64-linux-gnu/libbsd.so.0 Somehow I cannot find an MWE so far which shows the problem... |
@imjasonh : Could we set up a video call. That would be great. |
We have the same issue in our Pipeline with Jenkins and Kaniko in Version |
@imjasonh: Do you might have time next week for a video call or any other Kaniko Leada Dev? That would e great. |
Sure, ping me on the Kubernetes Slack and we can set up a time. I'm pretty free Monday. You should also join #kaniko if you aren't already in there. |
See: #2066 |
In Dockerfile, if there is something like: ``` RUN setcap cap_net_raw=+ep /path/to/binary ``` kaniko won't detect that there is a change on file `/path/to/binary` and thus discards this layer. This patch allows the hasher function to actually look at `security.capability` extended attributes.
This issue is still present in the latest version. Can someone else also confirm it? |
@nagpalkaran95 Do you have a minimal working example? |
@gabyx On digging deeper, I learned the issue is not just with symlinks but entire binaries/packages. The final image does not have any packages that were installed via apt. sample Dockerfile:
When running the command Also, the final image size is smaller in size than the size of the image being created using the Docker build command. Do you have any insights for this? I have tried other workarounds suggested for enabling cache, using cleanup arg etc. |
Actual behavior
I am attempting to migrate the image build process for our micro services from docker to kaniko and have realized that the kaniko built images fails to create files/symlinks generated by the OS packages.
Expected behavior
The image built from a
Dockerfile
using kaniko should the same as the ones built using Docker, it must include all files including symlinks.To Reproduce
Steps to reproduce the behavior:
Dockerfile
and build an image using kaniko and another one using docker, push both images to repo.libxdmcp6:amd64
generates a symlink/usr/lib/x86_64-linux-gnu/libXdmcp.so.6
pointing to/usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
which is missing in the image built using Kaniko and it does exist in the image built using Docker as shown below.Kaniko
Docker
This deviation from docker image is a show stopper as the applications depending on this library will fail to start if we use kaniko based images (will get errors similar to below), the app works fine if we use the image built with docker.
Additional Information
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: