From 6d7c028729809568921fcecce990572fbe6c35a8 Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Mon, 13 Nov 2017 18:04:17 +0800 Subject: [PATCH] Refine the Dockerfile Refine the Dockerfile to remove temporary workarounds. Also fixes #3587, to make sure the configuration files of rsyslog can be read by uid 10000. --- make/common/mariadb/Dockerfile | 2 +- make/common/nginx/Dockerfile | 2 +- make/common/postgresql/Dockerfile | 2 +- make/photon/adminserver/Dockerfile | 2 +- make/photon/jobservice/Dockerfile | 2 +- make/photon/log/Dockerfile | 4 ++-- tools/migration/Dockerfile | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/make/common/mariadb/Dockerfile b/make/common/mariadb/Dockerfile index c0e669a01..1f0435c90 100644 --- a/make/common/mariadb/Dockerfile +++ b/make/common/mariadb/Dockerfile @@ -2,7 +2,7 @@ FROM vmware/photon:1.0 #The Docker Daemon has to be running with storage backend btrfs when building the image -RUN tdnf distro-sync -y || echo \ +RUN tdnf distro-sync -y \ && tdnf install -y sed shadow procps-ng gawk gzip sudo net-tools \ && groupadd -r -g 10000 mysql && useradd --no-log-init -r -g 10000 -u 10000 mysql \ && tdnf install -y mariadb-server mariadb \ diff --git a/make/common/nginx/Dockerfile b/make/common/nginx/Dockerfile index 1c85bb5e6..9f6bd4353 100644 --- a/make/common/nginx/Dockerfile +++ b/make/common/nginx/Dockerfile @@ -1,6 +1,6 @@ FROM vmware/photon:1.0 -RUN tdnf distro-sync -y || echo \ +RUN tdnf distro-sync -y \ && tdnf install -y nginx \ && ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \ diff --git a/make/common/postgresql/Dockerfile b/make/common/postgresql/Dockerfile index f849234d4..37fbc1095 100644 --- a/make/common/postgresql/Dockerfile +++ b/make/common/postgresql/Dockerfile @@ -3,7 +3,7 @@ FROM vmware/photon:1.0 ENV PGDATA /var/lib/postgresql/data RUN touch /etc/localtime.bak \ - && tdnf distro-sync -y || echo \ + && tdnf distro-sync -y \ && tdnf install -y sed shadow gzip postgresql\ && groupadd -r postgres --gid=999 \ && useradd -r -g postgres --uid=999 postgres \ diff --git a/make/photon/adminserver/Dockerfile b/make/photon/adminserver/Dockerfile index 898881411..138a5ac80 100644 --- a/make/photon/adminserver/Dockerfile +++ b/make/photon/adminserver/Dockerfile @@ -1,7 +1,7 @@ FROM vmware/photon:1.0 RUN tdnf erase vim -y \ - && tdnf distro-sync -y || echo \ + && tdnf distro-sync -y \ && tdnf install -y sudo \ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \ diff --git a/make/photon/jobservice/Dockerfile b/make/photon/jobservice/Dockerfile index ee3d353f7..f8019d8c2 100644 --- a/make/photon/jobservice/Dockerfile +++ b/make/photon/jobservice/Dockerfile @@ -1,7 +1,7 @@ FROM vmware/photon:1.0 RUN mkdir /harbor/ \ - && tdnf distro-sync -y || echo \ + && tdnf distro-sync -y \ && tdnf install sudo -y \ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor diff --git a/make/photon/log/Dockerfile b/make/photon/log/Dockerfile index 7b31c75b5..1db6314b2 100644 --- a/make/photon/log/Dockerfile +++ b/make/photon/log/Dockerfile @@ -1,6 +1,6 @@ FROM vmware/photon:1.0 -RUN tdnf distro-sync -y || echo \ +RUN tdnf distro-sync -y \ && tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo net-tools\ && mkdir /etc/rsyslog.d/ \ && mkdir /var/spool/rsyslog \ @@ -17,7 +17,7 @@ RUN mv /etc/cron.daily/logrotate /etc/cron.hourly/logrotate COPY start.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/start.sh && \ - chown -R 10000:10000 /run + chown -R 10000:10000 /etc/rsyslog.conf /etc/rsyslog.d/ /run HEALTHCHECK CMD netstat -ltu|grep 10514 diff --git a/tools/migration/Dockerfile b/tools/migration/Dockerfile index c20665d78..7ed3b2716 100644 --- a/tools/migration/Dockerfile +++ b/tools/migration/Dockerfile @@ -1,6 +1,6 @@ FROM vmware/mariadb-photon:10.2.8 -RUN tdnf distro-sync || echo \ +RUN tdnf distro-sync \ && tdnf install -y mariadb-devel python2 python2-devel python-pip gcc\ linux-api-headers glibc-devel binutils zlib-devel openssl-devel \ && pip install mysqlclient alembic \