Home WORKDIR
Post
Cancel

WORKDIR

WORKDIR

WORKDIR command is used to define the working directory of a Docker container at any given time.

Any command(RUN,CMD,ADD,COPY etc) will be executed in the specified working directory.

1
2
3
FROM ubuntu:16.04
WORKDIR /project
RUN npm install

If the project directory does not exist, it will be created. The RUN command will be executed inside project.

This post is licensed under CC BY 4.0 by the author.

Trending Tags