LoginSignup
4
4

More than 5 years have passed since last update.

Docker のコンテナからファイルをコピーしてくる方法

Last updated at Posted at 2015-07-20

Docker のコンテナからファイルをコピーしてくる方法

最近 Docker を触り始めまして、戸惑うことが多いです。

さて表題なのです。
ポートフォワーディングせずにコンテナを立ち上げてしまったので、
コンテナ内のファイルをどう取り出すか悩んでいました。
ちゃんとコマンドがあるようです

$ docker cp -h

Usage: docker cp [OPTIONS] CONTAINER:PATH HOSTDIR|-

Copy files/folders from a PATH on the container to a HOSTDIR on the host
running the command. Use '-' to write the data as a tar file to STDOUT.

  --help=false       Print usage

コンテナをスタートさせてなくても取れるみたい。

hoghoge

4
4
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
4
4