Skip to content

Instantly share code, notes, and snippets.

@tetz-akaneya
Created July 27, 2018 23:27
Show Gist options
  • Save tetz-akaneya/df24c23083501c56759badffcb491be6 to your computer and use it in GitHub Desktop.
Save tetz-akaneya/df24c23083501c56759badffcb491be6 to your computer and use it in GitHub Desktop.
Dockerまとめ

https://docs.docker.com/storage/bind-mounts/#choosing-the--v-or---mount-flag

-v or --volume: Consists of three fields, separated by colon characters (:). The fields must be in the correct order, and the meaning of each field is not immediately obvious.
In the case of bind mounts, the first field is the path to the file or directory on the host machine.
The second field is the path where the file or directory is mounted in the container.
The third field is optional, and is a comma-separated list of options, such as ro, consistent, delegated, cached, z, and Z. These options are discussed below.

Qiita: 【Docker】Dockerでホストのディレクトリをマウントする

:で区切る。1個だけ指定した場合は第2引数部分となる(第1引数は/var/lib/dokcer/volumesに設定される) 第1引数にnameだけ指定した場合は、/var/lib/docker/volumes/のところにマウントされる。 <(bind mountの場合)HOSTでのpath>:<Containerでのpath>:<comma separated options(optional)>

-v で指定した時の第1引数(HOSTでのpath)がない場合、directoryとして作られる(--mountの時は作られない)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment