Rebuild Harbor images based on photon:2.0 (#6054)

Make necessary change to make things work with photon 2.0 docker image.
Remove distro-sync to mitigate the build issue and add `--pull` to docker build
command to make sure the latest photon:2.0 will be pulled during build process.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
Daniel Jiang 2018-10-18 11:03:28 +08:00 committed by Yan
parent 31914c04ee
commit 3d09089a9c
16 changed files with 32 additions and 64 deletions

View File

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

View File

@ -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/

View File

@ -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"]

View File

@ -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"]

View File

@ -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/

View File

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

View File

@ -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'

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;"]
CMD ["nginx", "-g", "daemon off;"]

View File

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

View File

@ -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"]
CMD ["/etc/registry/config.yml"]

View File

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