kaniko
kaniko copied to clipboard
Feature request: support --parents flag for COPY
Using Kaniko version v1.22.0, when I attempt to build this Dockerfile
# syntax=docker/dockerfile:1.7-labs
FROM scratch
# the [t] here conditionally copies version.txt in if it exists
COPY --parents alpine/ conda/ debian/ python/ security.txt version.tx[t] /
it fails:
error building image: parsing dockerfile: dockerfile parse error on line 5: unknown flag: parents
I reckon Kaniko doesn't yet support the 1.7-labs Dockerfile specification.
Workaround seems to be a more verbose but just as valid end result:
FROM scratch
COPY alpine/ /alpine/
COPY conda/ /conda/
COPY debian/ /debian/
COPY python/ /python/
# the [t] here conditionally copies version.txt in if it exists
COPY security.txt version.tx[t] /
Related issues
- https://github.com/GoogleContainerTools/kaniko/issues/1713
I'm hitting another use case wherein --parents would make life so much better as I'm combining a bunch of images into one and I'll have more explicit destination directories as a verbose result.