More than 5 years have passed since last update.
Dockerでホストとコンテナ間でのファイルコピー
622
Last updated at Posted at 2014-05-31
コンテナからホストへのコピー
docker cp コマンドが使えます。
# コンテナIDを調べる
$ sudo docker ps
$ sudo docker cp <コンテナID>:/etc/my.cnf my.cnf
ホストからコンテナへのコピー
(追記:2016/01/22)
Docker 1.8からホストからコンテナへのコピーも docker cp コマンドでサポートされるようになりました!
https://docs.docker.com/engine/reference/commandline/cp/
$ sudo docker cp my.cnf <コンテナID>:/etc/my.cnf
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
