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

COPY fails when multiple files are copied to path specified in ENV #2946

Closed
softmetz opened this issue Jan 12, 2024 · 1 comment · Fixed by #3034
Closed

COPY fails when multiple files are copied to path specified in ENV #2946

softmetz opened this issue Jan 12, 2024 · 1 comment · Fixed by #3034
Labels
area/dockerfile-command For all bugs related to dockerfile file commands cmd/copy kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next.

Comments

@softmetz
Copy link

Actual behavior
When I RUN

ENV TARGET_PATH=/target/path/

COPY /source/* $TARGET_PATH

Kaniko fails with

error building image: error building stage: failed to get files used from context: when specifying multiple sources in a COPY command, destination must be a directory and end in '/'

Expected behavior

COPY copies the files to the target directory

To Reproduce
Steps to reproduce the behavior:

See actual behaviour

Additional Information

  • Dockerfile
ENV TARGET_PATH=/target/path/

RUN mkdir -p $TARGET_PATH

COPY /source/* $TARGET_PATH
  • Build Context
.
└── source
    ├── bar
    └── foo
  • Kaniko Image (fully qualified with digest): gcr.io/kaniko-project/executor@sha256:899886a2db1c127ff1565d5c7b1e574af1810bbdad048e9850e4f40b5848d79c

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

Just got the same error on the same COPY issue

COPY /source/* target/

@aaron-prindle aaron-prindle added cmd/copy priority/p1 Basic need feature compatibility with docker build. we should be working on this next. kind/bug Something isn't working area/dockerfile-command For all bugs related to dockerfile file commands labels Jan 17, 2024
Greendor1234 added a commit to Greendor1234/kaniko that referenced this issue Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dockerfile-command For all bugs related to dockerfile file commands cmd/copy 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

Successfully merging a pull request may close this issue.

3 participants