🖥

#docker --mount オプションで ローカルとコンテナのファイルを同期させるコマンド例

に公開

Command example to synchronize local and container files with #docker --mount option

dockerコンテナを起動して、共有ディレクトリにファイルを作る

type=bind を指定して、ホストとゲストのディレクトリは両方、絶対パスで記述する

docker run -it --mount type=bind,src=/tmp,dst=/tmp alpine sh

/ # echo "ABC" > /tmp/some.txt

ローカルでファイルを開く

open /tmp/some.txt

image

Original by Github issue

https://github.com/YumaInaura/YumaInaura/issues/2388

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2019-09-04

Discussion