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.

失敗: Alpine 3.5.1上でLXD 2.8を使おうと試行錯誤した

Last updated at Posted at 2017-02-11

参考

setup-alpine

isoブートしsetup-alipine実行

  1. jp
  2. alpine
  3. [eth0]
  4. 192.168.9.51/24
  5. 192.168.9.1
  6. []
  7. []
  8. 8.8.8.8
  9. password1
  10. password2
  11. Asia/Tokyo
  12. []
  13. [f]
  14. [openssh]
  15. [chrony]
  16. sda
  17. sys
  18. y

reboot

再起動後

vi /etc/apk/repositories
# edge をコメントアウト
apk update
# 
apk add lxc lxd
# ネットワーク設定用
apk add dnsmasq iptables ip6tables
# ブリッジインターフェース用
apk add bridge-utils
# ssl通信用
apk add ca-certificates openssl

rc-update add lxd default

起動スクリプト追加

  • このままでは service lxd startlxd dameonが起動しないため以下修正
/etc/init.d/lxd
  #!/sbin/openrc-run
  # (c) 2016 Alpine Linux
  
  command="/usr/sbin/lxd"
  command_args="${LXD_OPTIONS}"
  command_background="true"
  pidfile="/var/run/${RC_SVCNAME}.pid"
  
  depend() {
  	need net
  	use lxcfs
  	after firewall
  }
  
+ start() {
+ 	ebegin "Starting ${SVCNAME}"
+ 	start-stop-daemon --start --background --exec \
+             $command $command_args daemon
+ 	eend $?
+ }

lxdの設定

# lxd daemon
service lxd start
lxd init --auto
$ lxc image list images: centos
+------------------------+--------------+--------+---------------------------------+--------+----------+-------------------------------+
|         ALIAS          | FINGERPRINT  | PUBLIC |           DESCRIPTION           |  ARCH  |   SIZE   |          UPLOAD DATE          |
+------------------------+--------------+--------+---------------------------------+--------+----------+-------------------------------+
| centos/6 (3 more)      | 37b6a126b5af | yes    | Centos 6 amd64 (20170211_02:16) | x86_64 | 124.95MB | Feb 11, 2017 at 12:00am (UTC) |
+------------------------+--------------+--------+---------------------------------+--------+----------+-------------------------------+
| centos/6/i386 (1 more) | b8d9470a1866 | yes    | Centos 6 i386 (20170211_02:16)  | i686   | 121.95MB | Feb 11, 2017 at 12:00am (UTC) |
+------------------------+--------------+--------+---------------------------------+--------+----------+-------------------------------+
| centos/7 (3 more)      | 3f220a619aba | yes    | Centos 7 amd64 (20170211_02:16) | x86_64 | 65.23MB  | Feb 11, 2017 at 12:00am (UTC) |
+------------------------+--------------+--------+---------------------------------+--------+----------+-------------------------------+
# lxc launch images:centos/6 cent01
lxc launch images:centos/6 cent01 -c security.privileged=true
lxc network attach lxdbr0 cent01
lxc start cent01 # <- 起動しない・・・。
lxc info cent01
lxc list
lxc exec cent01 -- bash # <- 起動しない・・・。

lxdのアンインストール

rc-update del lxd default
apk del lxd
rm -r /var/lib/lxd
ip link set lxdbr0 down
brctl delbr lxdbr0
reboot

トラブルシューティング

error: Get https://images.linuxcontainers.org/streams/v1/index.json: x509: failed to load system roots and no roots provided
wget https://images.linuxcontainers.org/streams/v1/index.json
wget: can't execute 'ssl_helper': No such file or directory

  • ca-certificates, openssl パッケージを入れる。
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?