12
12

More than 5 years have passed since last update.

ホストOSからDockerコンテナにファイルを送る方法

Last updated at Posted at 2015-05-29

ホストOSからDockerコンテナにファイルを送るには docker exec を利用します。

注意 execオプションはDocker1.3以上が必要です。

a.tar.gz の転送

HOST$ gzip -cd a.tar.gz | sudo docker exec -i <コンテナID> /bin/tar -C /tmp/ -xf -

/tmp の下に展開されます。

逆に、DockerコンテナからホストOSの場合、 docker cp を使えば素直にできます。

参考URL
https://github.com/docker/docker/issues/905

12
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
12