diff --git a/make/photon/Makefile b/make/photon/Makefile index e8d1f78a5d..12ea7d3c46 100644 --- a/make/photon/Makefile +++ b/make/photon/Makefile @@ -17,7 +17,7 @@ WGET=$(shell which wget) # docker parameters DOCKERCMD=$(shell which docker) -DOCKERBUILD=$(DOCKERCMD) build +DOCKERBUILD=$(DOCKERCMD) build --pull DOCKERRMIMAGE=$(DOCKERCMD) rmi DOCKERIMASES=$(DOCKERCMD) images diff --git a/make/photon/adminserver/Dockerfile b/make/photon/adminserver/Dockerfile index b090c00598..f0ec24883c 100644 --- a/make/photon/adminserver/Dockerfile +++ b/make/photon/adminserver/Dockerfile @@ -1,8 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf erase vim -y \ - && tdnf distro-sync -y \ - && tdnf install -y sudo >> /dev/null \ +RUN tdnf install -y sudo >> /dev/null \ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \ && mkdir /harbor/ diff --git a/make/photon/chartserver/Dockerfile b/make/photon/chartserver/Dockerfile index 2f423715af..4b3fdcb491 100644 --- a/make/photon/chartserver/Dockerfile +++ b/make/photon/chartserver/Dockerfile @@ -1,8 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf distro-sync -y \ - && tdnf erase vim -y \ - && tdnf install -y git shadow sudo bzr rpm xz python-xml >>/dev/null\ +RUN tdnf install -y shadow sudo >>/dev/null\ && tdnf clean all \ && mkdir /chartserver/ \ && groupadd -r -g 10000 chartuser \ @@ -17,7 +15,6 @@ RUN chown -R 10000:10000 /chartserver \ && chmod u+x /chartserver/chartm \ && chmod u+x /docker-entrypoint.sh - HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -sS 127.0.0.1:9999/health || exit 1 ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/make/photon/clair/Dockerfile b/make/photon/clair/Dockerfile index 3cec1dc760..355419df9e 100644 --- a/make/photon/clair/Dockerfile +++ b/make/photon/clair/Dockerfile @@ -1,9 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 - -RUN tdnf distro-sync -y \ - && tdnf erase vim -y \ - && tdnf install -y git shadow sudo bzr rpm xz python-xml >>/dev/null\ +RUN tdnf install -y git shadow sudo rpm xz python-xml >>/dev/null\ && tdnf clean all \ && mkdir /clair/ \ && groupadd -r -g 10000 clair \ @@ -21,7 +18,6 @@ RUN chown -R 10000:10000 /clair \ && chmod u+x /docker-entrypoint.sh \ && chmod +x /dumb-init - HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -sS 127.0.0.1:6061/health || exit 1 ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/make/photon/core/Dockerfile b/make/photon/core/Dockerfile index 5bc7be921a..ecf09e1369 100644 --- a/make/photon/core/Dockerfile +++ b/make/photon/core/Dockerfile @@ -1,8 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf distro-sync -y \ - && tdnf erase vim -y \ - && tdnf install sudo -y >> /dev/null\ +RUN tdnf install sudo -y >> /dev/null\ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \ && mkdir /harbor/ diff --git a/make/photon/db/Dockerfile b/make/photon/db/Dockerfile index 8c91a9fd33..dd4bbf6b25 100644 --- a/make/photon/db/Dockerfile +++ b/make/photon/db/Dockerfile @@ -1,12 +1,10 @@ -FROM photon:1.0 +FROM photon:2.0 ENV PGDATA /var/lib/postgresql/data -RUN touch /etc/localtime.bak \ - && tdnf distro-sync -y \ - && tdnf install -y sed shadow gzip postgresql >> /dev/null\ +RUN tdnf install -y shadow gzip postgresql >> /dev/null\ && groupadd -r postgres --gid=999 \ - && useradd -r -g postgres --uid=999 postgres \ + && useradd -m -r -g postgres --uid=999 postgres \ && mkdir -p /docker-entrypoint-initdb.d \ && mkdir -p /run/postgresql \ && chown -R postgres:postgres /run/postgresql \ @@ -14,8 +12,6 @@ RUN touch /etc/localtime.bak \ && mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA" \ && sed -i "s|#listen_addresses = 'localhost'.*|listen_addresses = '*'|g" /usr/share/postgresql/postgresql.conf.sample \ && sed -i "s|#unix_socket_directories = '/tmp'.*|unix_socket_directories = '/run/postgresql'|g" /usr/share/postgresql/postgresql.conf.sample \ - && touch /usr/share/locale/locale.alias \ - && locale-gen.sh en_US.UTF-8 \ && tdnf clean all VOLUME /var/lib/postgresql/data diff --git a/make/photon/db/docker-entrypoint.sh b/make/photon/db/docker-entrypoint.sh index c4622eaef4..c8f6672823 100644 --- a/make/photon/db/docker-entrypoint.sh +++ b/make/photon/db/docker-entrypoint.sh @@ -29,16 +29,13 @@ fi if [ "$1" = 'postgres' ]; then chown -R postgres:postgres $PGDATA - echo here1 # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then file_env 'POSTGRES_INITDB_ARGS' if [ "$POSTGRES_INITDB_XLOGDIR" ]; then export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR" fi - echo hehe2 su - $1 -c "initdb -D $PGDATA -U postgres -E UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 $POSTGRES_INITDB_ARGS" - echo hehe3 # check password first so we can output the warning before postgres # messes it up file_env 'POSTGRES_PASSWORD' diff --git a/make/photon/jobservice/Dockerfile b/make/photon/jobservice/Dockerfile index ebb46fe135..3131550d20 100644 --- a/make/photon/jobservice/Dockerfile +++ b/make/photon/jobservice/Dockerfile @@ -1,7 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 RUN mkdir /harbor/ \ - && tdnf distro-sync -y \ && tdnf install sudo -y >> /dev/null\ && 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 393a113d04..ef50d81b83 100644 --- a/make/photon/log/Dockerfile +++ b/make/photon/log/Dockerfile @@ -1,8 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf distro-sync -y \ - && tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo net-tools >> /dev/null\ - && mkdir /etc/rsyslog.d/ \ +RUN tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo >> /dev/null\ && mkdir /var/spool/rsyslog \ && groupadd -r -g 10000 syslog && useradd --no-log-init -r -g 10000 -u 10000 syslog \ && tdnf clean all diff --git a/make/photon/nginx/Dockerfile b/make/photon/nginx/Dockerfile index 9fc9ea4f4f..3d244ee580 100644 --- a/make/photon/nginx/Dockerfile +++ b/make/photon/nginx/Dockerfile @@ -1,7 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf distro-sync -y \ - && tdnf install -y nginx >> /dev/null\ +RUN tdnf install -y nginx >> /dev/null\ && ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \ && tdnf clean all diff --git a/make/photon/notary/server.Dockerfile b/make/photon/notary/server.Dockerfile index 1420690a44..4ec80d9368 100644 --- a/make/photon/notary/server.Dockerfile +++ b/make/photon/notary/server.Dockerfile @@ -1,8 +1,6 @@ -FROM photon:1.0 - -RUN tdnf distro-sync -y \ - && tdnf erase vim -y \ - && tdnf install -y shadow sudo \ +FROM photon:2.0 + +RUN tdnf install -y shadow sudo \ && tdnf clean all \ && groupadd -r -g 10000 notary \ && useradd --no-log-init -r -g 10000 -u 10000 notary diff --git a/make/photon/notary/signer.Dockerfile b/make/photon/notary/signer.Dockerfile index aa46ce1126..83784ff1f9 100644 --- a/make/photon/notary/signer.Dockerfile +++ b/make/photon/notary/signer.Dockerfile @@ -1,8 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf distro-sync -y \ - && tdnf erase vim -y \ - && tdnf install -y shadow sudo \ +RUN tdnf install -y shadow sudo \ && tdnf clean all \ && groupadd -r -g 10000 notary \ && useradd --no-log-init -r -g 10000 -u 10000 notary diff --git a/make/photon/portal/Dockerfile b/make/photon/portal/Dockerfile index 29cbc48f0b..74ced4e827 100644 --- a/make/photon/portal/Dockerfile +++ b/make/photon/portal/Dockerfile @@ -14,10 +14,9 @@ RUN /entrypoint.sh VOLUME ["/portal_src"] -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf distro-sync -y \ - && tdnf install -y nginx >> /dev/null \ +RUN tdnf install -y nginx >> /dev/null \ && ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \ && tdnf clean all @@ -32,4 +31,4 @@ STOPSIGNAL SIGQUIT HEALTHCHECK CMD curl --fail -s http://127.0.0.1 || exit 1 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"] diff --git a/make/photon/redis/Dockerfile b/make/photon/redis/Dockerfile index 6f27ee3566..efac15505b 100644 --- a/make/photon/redis/Dockerfile +++ b/make/photon/redis/Dockerfile @@ -1,7 +1,6 @@ -FROM photon:1.0 +FROM photon:2.0 -RUN tdnf distro-sync -y \ - && tdnf install -y redis sudo +RUN tdnf install -y redis sudo VOLUME /var/lib/redis WORKDIR /var/lib/redis diff --git a/make/photon/registry/Dockerfile b/make/photon/registry/Dockerfile index a26ccb0321..abc208db41 100644 --- a/make/photon/registry/Dockerfile +++ b/make/photon/registry/Dockerfile @@ -1,11 +1,9 @@ -FROM photon:1.0 +FROM photon:2.0 MAINTAINER wangyan@vmware.com # The original script in the docker offical registry image. -RUN tdnf distro-sync -y \ - && tdnf erase vim -y \ - && tdnf install sudo -y >> /dev/null\ +RUN tdnf install sudo -y >> /dev/null\ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor @@ -22,4 +20,4 @@ HEALTHCHECK CMD curl 127.0.0.1:5000/ VOLUME ["/var/lib/registry"] EXPOSE 5000 ENTRYPOINT ["/entrypoint.sh"] -CMD ["/etc/registry/config.yml"] \ No newline at end of file +CMD ["/etc/registry/config.yml"] diff --git a/make/photon/registryctl/Dockerfile b/make/photon/registryctl/Dockerfile index ba3bbc65e6..16fc3fcf24 100644 --- a/make/photon/registryctl/Dockerfile +++ b/make/photon/registryctl/Dockerfile @@ -1,10 +1,8 @@ -FROM photon:1.0 +FROM photon:2.0 MAINTAINER wangyan@vmware.com -RUN tdnf distro-sync -y \ - && tdnf erase vim -y \ - && tdnf install sudo -y >> /dev/null\ +RUN tdnf install sudo -y >> /dev/null\ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \ && mkdir -p /etc/registry