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

Image is missing files copied from the previous stage #3318

Open
romanov-is-here opened this issue Sep 18, 2024 · 0 comments
Open

Image is missing files copied from the previous stage #3318

romanov-is-here opened this issue Sep 18, 2024 · 0 comments

Comments

@romanov-is-here
Copy link

Actual behavior

I'm trying to install a tool and its dependencies in the first stage and copy it to another. There are no copied files in the final image when I'm building it with Kaniko.

Expected behavior

Copied files are expected to be in the image.

To Reproduce
Dockerfile

FROM debian:stable-slim as builder

RUN apt update && \
    apt install -y iproute2

RUN mkdir -p /dependencies && \
    ldd /sbin/ip | grep '=>' | awk '{print $3}' | xargs -I '{}' cp '{}' /dependencies/

FROM gcr.io/distroless/base-debian12

COPY --from=builder /sbin/ip /sbin/ip
COPY --from=builder /dependencies /usr/lib/x86_64-linux-gnu/

CMD ["/sbin/ip", "-V"]

Build command

docker run --rm -v .:/workspace -v ./config.json:/kaniko/.docker/config.json gcr.io/kaniko-project/executor:latest --destination=<private hub> --use-new-run --cleanup

config.json only contains credentials for the private hub

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant