I am trying to do a conditional COPY in Dockerfile.
The problem is that I can't do it the way as I did, as since RUN executes in sh/bash the condition operation is brought from sh/bash, not from the RUN instruction itself.
RUN if [ "$PARAM" = "dev" ]; then \
COPY /somefolder/* ./; \
else \
COPY /somefolder/* .; \
fi
This results in a COPY not found message.
I want to COPY the SAME folder, just to different target.
If the condition is true, copy that folder to ./
If not true, copy to .
Is there any workaround to do this via docker command?