Docker Community Forums

Share and learn in the Docker community.

Complex conditional inside Dockerfile

I need to derive from multiple base images and also take some decisions.

IF build-arg 1 == yes
RUN this and RUN this etc

IF build-arg 2 == yes
RUN this and RUN this etc

So, each decision has multiple RUN commands that must be ran.
Also, what is the practice when a layer installs besides large packages in knows locations, multiples python packages ?
It is ok to copy from other image the python installation dir ?