0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

dockerイメージから特定のファイルを出力する

Last updated at Posted at 2020-04-18

設定ファイルのデフォルトを抜き出したい時とか。

docker run -it --rm $IMAGE cat $DOCKERFILEPATH > $LOCALFILEPATH

% docker run -it --rm busybox cat /proc/version > busybox_ver.txt
Linux version 4.19.76-linuxkit (root@d203b39a3d78) (gcc version 8.3.0 (Alpine 8.3.0)) #1 SMP Thu Oct 17 19:31:58 UTC 2019

| tee で渡すと出力見れる。

起きているDockerコンテナからファイルを出したいとき(コピー)はこちら

docker cp $DOCKERID:$CONTAINERFILEPATH $HOSTFILEPATH
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?