I can define "static" environment variables in a Docker file with ENV , but is it possible to pass some value during the assembly of this variable? I am trying something like this that doesn't work:
FROM phusion/baseimage RUN mkdir -p /foo/2016/bin && \ FOOPATH=`ls -d /foo/20*/bin` && \ export FOOPATH ENV PATH $PATH:$FOOPATH
Of course, in the real case, I will run / unzip something that creates a directory whose name will change with different versions, dates, etc., and I would like to avoid modifying the Docker file every time the directory changes its name.
Edit: since this seems impossible, the best workaround so far is to use a symbolic link:
FROM phusion/baseimage RUN mkdir -p /foo/2016/bin && \ FOOPATH=`ls -d /foo/20*/bin` && \ ln -s $FOOPATH /mypath ENV PATH $PATH:/mypath
source share