Docker Community Forums

Share and learn in the Docker community.

'if' statement in dockerfile


(Armandb) #1

Hello,

I want to build a docker image based on the debian image. In the dockerfile, I’d like to check if the python3 version installed is 3.5 or 3.6 and accordingly run a different command.

(I know that right know debian distributes only 3.5 version but my plan is to be ready for when they’ll move to 3.6.)

How could I do that ?

Thanks a lot


(Think) #2

why not do the “if” within a bash command?


(Armandb) #3

Yep, of course! Sorry for the stupid question. I was too deep into my thoughts :stuck_out_tongue: