LoginSignup
13
13

More than 5 years have passed since last update.

kitchen-dockerで動くCentOS7 Dockerコンテナ

Last updated at Posted at 2014-09-23

動く:SSHが繋がり、kitchen-docker経由でserviceコマンドが使える、chef_zeroのプロビジョニングが動作する

.kitchen.yml
  - name: centos-7.0
    driver_config:
      image: 2k0ri/centos7-systemd
      privileged: true
      run_command: /sbin/init; sleep 3

解説

2k0ri/centos7-systemdコンテナのDockerfileは以下です。

Dockerfile
FROM centos:centos7
MAINTAINER 2k0ri esc13245@gmail.com

RUN yum swap -y fakesystemd systemd
RUN yum install -y initscripts

CMD ["/sbin/init", "3"]

systemdを復活させるためにCentOS 7のDockerコンテナ内でsystemdを使ってサービスを起動する - Qiitaの手順に則っています。

/sbin/initでsystemdのサービスが起動するため、sshdも立ち上がるはずなのですが
実行直後は起動が完了しておらず、接続に失敗する様子。

OSXからyungsang/coreos-alphaにソケット経由でコンテナを立てている手元の環境では
パフォーマンスによってばらつきがあり、最低3秒、最長15秒のsleepが必要でした。

13
13
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
13
13