[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
Open chat
Powered by