summaryrefslogtreecommitdiffstats
path: root/ansible/test/images
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-04-05 10:10:12 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-04-05 12:51:09 +0200
commitc4378cff44c04126e9287de301bacd0bd520f2de (patch)
tree88c0da5feb2dec536d06fa15105e4793c868a8d5 /ansible/test/images
parent324c13b62331292a5ea7dbc6ee6442e976cbb2a4 (diff)
Simplify Centos Dockerfile for Molecule
Base the Centos image for molecule on official CentOS systemd docker container. Align the tagging policy with Centos images on docker hub. Change-Id: Ia2743ab78faed858dc5a7f3611cffb779b23d463 Issue-ID: OOM-1774 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/test/images')
-rw-r--r--ansible/test/images/docker/centos7/Dockerfile23
-rwxr-xr-xansible/test/images/docker/centos7/build.sh3
-rw-r--r--ansible/test/images/docker/centos7/dbus.service16
3 files changed, 3 insertions, 39 deletions
diff --git a/ansible/test/images/docker/centos7/Dockerfile b/ansible/test/images/docker/centos7/Dockerfile
index 8c024ab9..289ee8c6 100644
--- a/ansible/test/images/docker/centos7/Dockerfile
+++ b/ansible/test/images/docker/centos7/Dockerfile
@@ -1,29 +1,8 @@
-# https://github.com/chrismeyersfsu/provision_docker/tree/master/files
-FROM centos:centos7
-ENV container docker
-
-RUN yum -y update; yum clean all
-
-RUN systemctl mask dev-mqueue.mount dev-hugepages.mount \
- systemd-remount-fs.service sys-kernel-config.mount \
- sys-kernel-debug.mount sys-fs-fuse-connections.mount \
- display-manager.service graphical.target systemd-logind.service
+FROM centos/systemd
RUN yum -y install openssh-server sudo openssh-clients \
epel-release python-docker-py iproute
-RUN sed -i 's/#PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config
-RUN ssh-keygen -q -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa && \
- ssh-keygen -q -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa && \
- ssh-keygen -q -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
-RUN echo 'root:docker.io' | chpasswd
RUN systemctl enable sshd.service
-
-# firewalld needs this .. and I needs my firewalld
-ADD dbus.service /etc/systemd/system/dbus.service
-RUN systemctl enable dbus.service
-
-VOLUME ["/run"]
-
EXPOSE 22
CMD ["/usr/sbin/init"]
diff --git a/ansible/test/images/docker/centos7/build.sh b/ansible/test/images/docker/centos7/build.sh
index fe0aea66..dede5215 100755
--- a/ansible/test/images/docker/centos7/build.sh
+++ b/ansible/test/images/docker/centos7/build.sh
@@ -19,4 +19,5 @@
# COPYRIGHT NOTICE ENDS HERE
set -e
-docker build . -t molecule-centos7:latest
+TAG=${1:-centos7.6}
+docker build . -t molecule-centos:${TAG}
diff --git a/ansible/test/images/docker/centos7/dbus.service b/ansible/test/images/docker/centos7/dbus.service
deleted file mode 100644
index 69dbb153..00000000
--- a/ansible/test/images/docker/centos7/dbus.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=D-Bus System Message Bus
-Requires=dbus.socket
-After=syslog.target
-
-[Service]
-PIDFile=/var/run/messagebus.pid
-ExecStartPre=/bin/mkdir -p /var/run/dbus
-ExecStartPre=/bin/chmod g+w /var/run/ /var/run/dbus/
-ExecStart=/bin/dbus-daemon --system --fork
-ExecReload=/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
-ExecStopPost=/bin/rm -f /var/run/messagebus.pid
-#OOMScoreAdjust=-900
-User=dbus
-Group=root
-PermissionsStartOnly=true