Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Instruction MKDIR

Summary

MKDIR [<file-options>] <path>

Tip

See the section on file options.

The MKDIR instruction creates an empty directory inside the build target.

This is roughly equivalent to the following command:

RUN mkdir /foo

However, using RUN mkdir requires the mkdir command to be available and executable inside the build target. This is not always the case, especially when building things from scratch.

Example

MKDIR /data

MKDIR -p --chown babelfish:daemon /usr/local/translate/