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

Multistage COPY fails gcr.io/kaniko-project/executor:debug #1280

Closed
dmilan77 opened this issue May 23, 2020 · 5 comments
Closed

Multistage COPY fails gcr.io/kaniko-project/executor:debug #1280

dmilan77 opened this issue May 23, 2020 · 5 comments

Comments

@dmilan77
Copy link

I just tested with gcr.io/kaniko-project/executor:debug

#: Dockerfile
FROM python:3.7.7-slim-buster as part-one
RUN set -x \
    && python -m venv /venv
RUN ls -l /venv

FROM python:3.7.7-slim-buster
COPY --from=part-one /venv /venv
RUN ls -l /venv

It's failing.

INFO[0016] args: [-c ls -l /venv]
ls: cannot access '/venv': No such file or directory
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 2

Originally posted by @dmilan77 in #1110 (comment)

@MAHDTech
Copy link

Do you by chance have a .dockerignore file?

There seems to be a recent regression where the .dockerignore is read during multi-stage builds so the files are ignored when the copy takes place.

I use a .dockerignore in whiltelist mode and this caught me out as as well.

@dmilan77
Copy link
Author

Do you by chance have a .dockerignore file?

There seems to be a recent regression where the .dockerignore is read during multi-stage builds so the files are ignored when the copy takes place.

I use a .dockerignore in whiltelist mode and this caught me out as as well.

It did the trick. Seems still a bug.

@ejose19
Copy link
Contributor

ejose19 commented May 25, 2020

Same case here, using .dockerignore in whitelist mode, either removing the .dockerignore or setting it to * right before the building may be a workaround while this is solved

@tejal29
Copy link
Member

tejal29 commented Jun 5, 2020

@ejose19 Can you try with latest v0.23.0 version? With this release, .dockerignore is only applied for copy statements in first stage.

@ejose19
Copy link
Contributor

ejose19 commented Jun 9, 2020

@tejal29 Can confirm v0.23.0 fixed the issue.

OT: Can you take a look on this issue #1265 ? It still doesn't work even on latest release.

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

4 participants