2
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 5 years have passed since last update.

【2019年4月版】LXC/LXDでホストのディレクトリをコンテナ内にコピーする

Posted at

ホストの特定ディレクトリだけ、コンテナ内にコピーしたい。

コンテナにマウントではなく、特定ディレクトリだけコピーしたい場合は以下のコマンド。

$ tar cf - /path/on/host | lxc exec container -- tar xvf - -C /path/on/target

コンテナ内のカレントディレクトリに送り元と同じディレクトリ名で展開していいなら-Cは省略可能です。

$ tar cf - /path/on/host | lxc exec container -- tar xvf -

元ネタ:
https://github.com/lxc/lxd/issues/1218

2
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
2
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?