How to RUN docker commands inside a folder
How using a Dockerfile can I
RUN all commands within a folder home?
For example, in Docker I have the following where I have to
CD into the folder before running the second command:
RUN cd /var/sites/demo && virtualenv env --system-site-packages RUN cd /var/sites/demo && pip install -r requirements.txt
Is there a way I can remove the
cd /var/sites/demo and have each command run from that location?
One Solution collect form web for “How to RUN docker commands inside a folder”
WORKDIR to the appropriate path:
The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile.
So your file should have: