Skip to content

COPY with glob is incompatible with Docker #3069

Closed
@jimsnab

Description

Actual behavior

Given
COPY file_that_might_not_exis[t] /dest

Kaniko returns this error when the file does not exist

failed to get files used from context: copy failed: no source files specified

Expected behavior

Match current Docker behavior - when glob is used, COPY does not need to copy at least one file.

To Reproduce

  1. Try simple dockerfile

Additional Information

  • Dockerfile
FROM alpine
COPY known_host[s] /etc/ssh/ssh_known_hosts
  • Build Context

Don't make the known_hosts file.

  • Kaniko Image (fully qualified with digest)

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [No]
Please check if the build works in docker but not in kaniko
  • - [Yes]
Please check if this error is seen when you use --cache flag
  • - [Yes]
Please check if your dockerfile is a multistage dockerfile
  • - [Yes]

Metadata

Assignees

No one assigned

    Labels

    area/dockerfile-commandFor all bugs related to dockerfile file commandscmd/copydiffers-from-dockerkind/bugSomething isn't workingpriority/p0Highest priority. Break user flow. We are actively looking at delivering it.priority/p1Basic need feature compatibility with docker build. we should be working on this next.works-with-docker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions