Docker Community Forums

Share and learn in the Docker community.

How to UPDATE Docker container PATH using commit “--change” flag?

docker

(Ribakov) #1

In short, what is the right way to achieve the same result as

ENV PATH=/usr/local/texlive:${PATH}

would have produced when placed in Dockerfile by using docker commit --change "ENV ..." flag?

Documentation states that --change flag supports ENV instruction and so I have tried following notations but none of them has worked:

docker commit -c "ENV PATH /usr/local/texlive/bin:${PATH}" 3b459018aa84 test-changes
docker commit -c 'ENV PATH /usr/local/texlive/bin:${PATH}' 3b459018aa84 test-changes
docker commit -c "ENV PATH=\"/usr/local/texlive/bin:${PATH}\"" 3b459018aa84 test-changes
docker commit -c 'ENV PATH=\"/usr/local/texlive/bin:${PATH}\"' 3b459018aa84 test-changes
docker commit -c 'ENV PATH="/usr/local/texlive/bin:${PATH}"' 3b459018aa84 test-changes
docker commit -c 'ENV PATH="/usr/local/texlive/bin:${PATH}"' -p=false 3b459018aa84 test-changes

For more detailed description and outputs of those commands you can check my SO question.


(Ribakov) #2

It’s a bug in Moby Project. Upgrading to Docker v18.02 fixed the issue for me.