LoginSignup
6
6

More than 5 years have passed since last update.

Automated BuildでCentOS7 + systemdのイメージ作った

Last updated at Posted at 2014-10-26

参考

@yunanoさんのCentOS 7のDockerコンテナ内でsystemdを使ってサービスを起動する - Qiita

説明

1. systemdとvim追加

centos7-ja-systemd
docker run --privileged -it -d --name centos7 tukiyo3/centos7-ja-systemd
docker exec -it centos7 bash

2. systemdとansibleなど追加

centos7-ansible
docker run --privileged -it -d --name centos7 tukiyo3/centos7-ansible
docker exec -it centos7 bash

3. lampp環境php5.6

centos7-lampp
docker run --privileged -it -d -p 8080:80 --name centos7 tukiyo3/centos7-lampp
docker exec -it centos7 bash

DockerHubのハマりどころ

  • DockerHubのビルドは全タグを一斉にビルドする。
  • 自身のタグをfrom指定している場合、元のイメージが更新されていない状態でビルドされる。
  • そのためDockerHubリポジトリを分けること。
  • またDockerHubリポジトリには1つのDockerfileしか表示されないので不便でしょう。
  • GithubへpushしたらAutomated Buildが行われる設定は不便な時もあるので無効にしておいたほうがよい。

スクリーンショット 2014-10-27 13.55.08.png

例:

  • tukiyo3/centos7-ja-systemd:systemd
  • tukiyo3/centos7-ja-systemd:ansible

というタグがあった場合、

  • tukiyo3/centos7-ja-systemd:ansible

from tukiyo3/centos7-ja-systemd:systemd指定していると、
tukiyo3/centos7-ja-systemd:systemd側で変更があったら
tukiyo3/centos7-ja-systemd:ansible側に変更が取り込まれずビルドされる。

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