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

パブリックなLXDイメージリポジトリの構築と、構築したパブリックLXDイメージリポジトリからのイメージ取得

Last updated at Posted at 2018-11-07

LXDイメージリポジトリの構築

LXDイメージリポジトリとするサーバ(LXDイメージリポジトリサーバ)で設定を行います。

# lxd init
Would you like to use LXD clustering? (yes/no) [default=no]: no
Do you want to configure a new storage pool? (yes/no) [default=yes]: yes
Name of the new storage pool [default=default]: default
Name of the storage backend to use (btrfs, dir, lvm) [default=btrfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]: no
Would you like to create a new local network bridge? (yes/no) [default=yes]: yes
What should the new bridge be called? [default=lxdbr0]: lxdbr0
What IPv4 address should be used? (CIDR subnet notation, auto or none) [default=auto]: auto
Would you like LXD to NAT IPv4 traffic on your bridge? [default=yes]: yes
What IPv6 address should be used? (CIDR subnet notation, auto or none) [default=auto]: none
Would you like LXD to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]: all
Port to bind LXD to [default=8443]: 8443
Trust password for new clients:  <パスワードを入力>
Again: <パスワードを入力>
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] : yes
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: no

LXDイメージリポジトリへのイメージ追加(パブリッシュ)

LXDイメージリポジトリサーバで行う場合

# lxc publish <LXDコンテナ名> --public --alias <LXDコンテナイメージ名>

LXDイメージリポジトリサーバとは別のサーバ等で行う場合

# lxc publish <LXDコンテナ名> <LXDイメージリポジトリサーバ>: --public --alias <LXDコンテナイメージ名>

なお、イメージ追加を行うサーバ等においては、事前にLXDリポジトリサーバと相互に接続可能な状態とする必要があります。追加されていない場合は、以下のコマンドでLXDイメージリポジトリを追加します。

# lxc config set core.https_address "[::]:8443"
# lxc remote add https://<LXDイメージリポジトリサーバのIPアドレスまたはURL>:<ポート(デフォルト:8443)>

パブリックLXDイメージリポジトリの追加

LXDイメージリポジトリサーバ上のイメージを利用したいサーバ等より操作を行います。

# lxc config set core.https_address "[::]:8443"
# lxc remote add https://<LXDイメージリポジトリサーバのIPアドレスまたはURL>:<ポート(デフォルト:8443)> --public

パブリックLXDイメージリポジトリの利用

LXDイメージリポジトリサーバ上のイメージを利用したいサーバ等より操作を行います。

イメージ一覧の取得

# lxc image list <LXDイメージリポジトリサーバ>:

イメージを使用してコンテナを起動

# lxc launch <LXDイメージリポジトリサーバ>:<LXDコンテナイメージ名> --alias <LXDコンテナ名(エイリアス)>
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?