[SOLVED] Run RUN, CMD, ADD, COPY, or ENTRYPOINT command in a specified working directory.

Using WORKDIR command will make it a lot easier to to define the working directory of a Docker container at any line when you want to execute the bellow commands. The command is specified in the Dockerfile. Exemple:

FROM ubuntu:16.04

WORKDIR /app

RUN npm install 

WORKDIR ../modern

RUN touch file1.cpp

Don’t miss these tips!

We don’t spam! Read our privacy policy for more info.

Open chat
Powered by