GoogleContainerTools / kaniko

Build Container Images In Kubernetes
Apache License 2.0
14.88k stars 1.44k forks source link

COPY behaviour with --chown is not consistent with docker #1594

Open ghost opened 3 years ago

ghost commented 3 years ago

Actual behavior When trying to use COPY with --chown and giving an envvar as an argument, build fails, while working perfectly fine in docker 20.10.3.

Expected behavior Image is built correctly while assigning ownership from env variable

To Reproduce Steps to reproduce the behavior:

  1. Set up a Dockerfile with ENV and COPY directive
  2. COPY something with --chown ${VARNAME}

Additional Information

guillaume-d commented 2 years ago

From v1.8.0 onwards this is no longer a syntax error for ADD at least (and COPY should behave similarly).

I did not test if kaniko really sets the owner as expected though, so beware: it might be failing silently now! :roll_eyes:

(Note that this is a dockerfile/1.2.0 feature, which kaniko still does not fully support, see for example https://github.com/GoogleContainerTools/kaniko/issues/1568.)