FROM ubuntu:14.04
ARG SOME_PASSWORD
RUN echo $SOME_PASSWORD >> file.password
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT /docker-entrypoint.sh
docker build -t test_image .
docker run -e SOME_PASSWORD='password12345' --restart=always -it test_image
echo "mysecretpassword" > file.password
...
MYVAR=$(cat file.password)
docker run -e SOME_PASSWORD="$MYVAR" --restart=always -it test_image
echo "MYVAR=mysecretpasswowrd">file.password
...
. file.password
docker run -e SOME_PASSWORD="$MYVAR" --restart=always -it test_image