1
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.

systemd-nspawnAdvent Calendar 2017

Day 6

systemd-nspawnでレガシー(Not systemd)なコンテナを動かすには

Posted at

systemd-nspawn Advent Calendar 2017 6日目の記事です。

systemd-nspawnはsystemd採用のコンテナ以外でも動かせますというお話し

upstart採用のcentos6を動かしてみます
今回もDockerhubにあったcentos6のイメージをインポートしておきます

cd /var/lib/machines
# os-releaseが無いと起動しないので入れておきます
curl -L https://goo.gl/D6rtHR > centos6/etc/os-release
# 必要そうなやつ入れておく
yum install openssh-server
# initで処理したいものを書いておく
curl -L https://goo.gl/bvi8bq > centos6/sbin/init
chmod +x centos6/sbin/init
systemd-nspawn -D centos6 -b --network-bridge br0

yum install upstartしてからupstartから全部上げる方法もありますが、よくこんな方法で起動しています
要は/sbin/initに立ちあげたい処理を書いて、起動しっぱなしにしとけばいいだけです

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