Within a Dockerfile, I'd like to execute a Dockerfile command (e.g. ADD or COPY etc...) according to a build flag
FROM ...
ARG doit=no
RUN if [ $doit != no ]; then \ ADD foo.tar.gz / ; \ fi
When passing --build-arg doit=something to the docker build command I'd like the foo archive to be expanded in /
I do not seem to be able to execute a Dockerfile command inside a RUN
Any workaround?