From charlesreid1

Revision as of 03:10, 24 March 2017 by Admin (talk | contribs) (Created page with "=Navigating= ==Filesystem basics== ===Working directory=== You can set the working directory using the -w flag: <pre> $ docker run -w /path/to/dir/ -i -t ubuntu pwd </pr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Navigating

Filesystem basics

Working directory

You can set the working directory using the -w flag:

$ docker  run -w /path/to/dir/ -i -t  ubuntu pwd

Volumes

You can set storage drive options using storage opt fllag:

$ docker run -it --storage-opt size=120G fedora /bin/bash

You can also mount external (your machine) drives/folders inside the Docker container:

$ docker  run  \
  -v `pwd`:`pwd` \
  -w `pwd` \
  -i -t  ubuntu pwd


The -v flag mounts the current working directory into the container. The -w lets the command being executed inside the current working directory, by changing into the directory to the value returned by pwd. So this combination executes the command using the container, but inside the current working directory.

Docker run documentation