mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
Merge pull request #9828 from wy65701436/cii-docker-base
add base images when to build harbor assets
This commit is contained in:
commit
2fcd174e4b
11
Makefile
11
Makefile
@ -88,6 +88,8 @@ CHARTFLAG=false
|
|||||||
# version prepare
|
# version prepare
|
||||||
# for docker image tag
|
# for docker image tag
|
||||||
VERSIONTAG=dev
|
VERSIONTAG=dev
|
||||||
|
# for base docker image tag
|
||||||
|
BASEIMAGETAG=dev
|
||||||
# for harbor package name
|
# for harbor package name
|
||||||
PKGVERSIONTAG=dev
|
PKGVERSIONTAG=dev
|
||||||
|
|
||||||
@ -321,7 +323,14 @@ build:
|
|||||||
-e CLAIRVERSION=$(CLAIRVERSION) -e CLAIRADAPTERVERSION=$(CLAIRADAPTERVERSION) -e VERSIONTAG=$(VERSIONTAG) \
|
-e CLAIRVERSION=$(CLAIRVERSION) -e CLAIRADAPTERVERSION=$(CLAIRADAPTERVERSION) -e VERSIONTAG=$(VERSIONTAG) \
|
||||||
-e BUILDBIN=$(BUILDBIN) -e REDISVERSION=$(REDISVERSION) -e MIGRATORVERSION=$(MIGRATORVERSION) \
|
-e BUILDBIN=$(BUILDBIN) -e REDISVERSION=$(REDISVERSION) -e MIGRATORVERSION=$(MIGRATORVERSION) \
|
||||||
-e CHARTMUSEUMVERSION=$(CHARTMUSEUMVERSION) -e DOCKERIMAGENAME_CHART_SERVER=$(DOCKERIMAGENAME_CHART_SERVER) \
|
-e CHARTMUSEUMVERSION=$(CHARTMUSEUMVERSION) -e DOCKERIMAGENAME_CHART_SERVER=$(DOCKERIMAGENAME_CHART_SERVER) \
|
||||||
-e NPM_REGISTRY=$(NPM_REGISTRY)
|
-e NPM_REGISTRY=$(NPM_REGISTRY) -e BASEIMAGETAG=${BASEIMAGETAG}
|
||||||
|
|
||||||
|
build_base_docker:
|
||||||
|
@for name in chartserver clair clair-adapter core db jobservice log nginx notary-server notary-signer portal prepare redis registry registryctl; do \
|
||||||
|
echo $$name ; \
|
||||||
|
$(DOCKERBUILD) --pull -f $(MAKEFILEPATH_PHOTON)/$$name/Dockerfile.base -t goharbor/harbor-$$name-base:$(BASEIMAGETAG) . ; \
|
||||||
|
$(PUSHSCRIPTPATH)/$(PUSHSCRIPTNAME) goharbor/harbor-$$name-base:$(BASEIMAGETAG) $(REGISTRYUSER) $(REGISTRYPASSWORD) ; \
|
||||||
|
done
|
||||||
|
|
||||||
install: compile build prepare start
|
install: compile build prepare start
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ WGET=$(shell which wget)
|
|||||||
|
|
||||||
# docker parameters
|
# docker parameters
|
||||||
DOCKERCMD=$(shell which docker)
|
DOCKERCMD=$(shell which docker)
|
||||||
DOCKERBUILD=$(DOCKERCMD) build --pull
|
DOCKERBUILD=$(DOCKERCMD) build
|
||||||
DOCKERRMIMAGE=$(DOCKERCMD) rmi
|
DOCKERRMIMAGE=$(DOCKERCMD) rmi
|
||||||
DOCKERIMASES=$(DOCKERCMD) images
|
DOCKERIMASES=$(DOCKERCMD) images
|
||||||
|
|
||||||
@ -81,9 +81,11 @@ DOCKERFILENAME_REGISTRYCTL=Dockerfile
|
|||||||
DOCKERIMAGENAME_REGISTRYCTL=goharbor/harbor-registryctl
|
DOCKERIMAGENAME_REGISTRYCTL=goharbor/harbor-registryctl
|
||||||
|
|
||||||
DOCKERFILEPATH_NOTARY=$(DOCKERFILEPATH)/notary
|
DOCKERFILEPATH_NOTARY=$(DOCKERFILEPATH)/notary
|
||||||
DOCKERFILENAME_NOTARYSIGNER=signer.Dockerfile
|
DOCKERFILEPATH_NOTARYSERVER=$(DOCKERFILEPATH)/notary-server
|
||||||
|
DOCKERFILENAME_NOTARYSIGNER=Dockerfile
|
||||||
DOCKERIMAGENAME_NOTARYSIGNER=goharbor/notary-signer-photon
|
DOCKERIMAGENAME_NOTARYSIGNER=goharbor/notary-signer-photon
|
||||||
DOCKERFILENAME_NOTARYSERVER=server.Dockerfile
|
DOCKERFILEPATH_NOTARYSIGNER=$(DOCKERFILEPATH)/notary-signer
|
||||||
|
DOCKERFILENAME_NOTARYSERVER=Dockerfile
|
||||||
DOCKERIMAGENAME_NOTARYSERVER=goharbor/notary-server-photon
|
DOCKERIMAGENAME_NOTARYSERVER=goharbor/notary-server-photon
|
||||||
|
|
||||||
DOCKERFILEPATH_REDIS=$(DOCKERFILEPATH)/redis
|
DOCKERFILEPATH_REDIS=$(DOCKERFILEPATH)/redis
|
||||||
@ -103,32 +105,32 @@ CHART_SERVER_BIN_NAME=chartm
|
|||||||
|
|
||||||
_build_prepare:
|
_build_prepare:
|
||||||
@echo "building prepare container for photon..."
|
@echo "building prepare container for photon..."
|
||||||
@$(DOCKERBUILD) -f $(DOCKERFILEPATH_PREPARE)/$(DOCKERFILENAME_PREPARE) -t $(DOCKERIMAGENAME_PREPARE):$(VERSIONTAG) .
|
@$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_PREPARE)/$(DOCKERFILENAME_PREPARE) -t $(DOCKERIMAGENAME_PREPARE):$(VERSIONTAG) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_db:
|
_build_db:
|
||||||
@echo "building db container for photon..."
|
@echo "building db container for photon..."
|
||||||
@$(DOCKERBUILD) -f $(DOCKERFILEPATH_DB)/$(DOCKERFILENAME_DB) -t $(DOCKERIMAGENAME_DB):$(VERSIONTAG) .
|
@$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_DB)/$(DOCKERFILENAME_DB) -t $(DOCKERIMAGENAME_DB):$(VERSIONTAG) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_portal:
|
_build_portal:
|
||||||
@echo "building portal container for photon..."
|
@echo "building portal container for photon..."
|
||||||
$(DOCKERBUILD) --build-arg npm_registry=$(NPM_REGISTRY) -f $(DOCKERFILEPATH_PORTAL)/$(DOCKERFILENAME_PORTAL) -t $(DOCKERIMAGENAME_PORTAL):$(VERSIONTAG) .
|
$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg npm_registry=$(NPM_REGISTRY) -f $(DOCKERFILEPATH_PORTAL)/$(DOCKERFILENAME_PORTAL) -t $(DOCKERIMAGENAME_PORTAL):$(VERSIONTAG) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_core:
|
_build_core:
|
||||||
@echo "building core container for photon..."
|
@echo "building core container for photon..."
|
||||||
@$(DOCKERBUILD) -f $(DOCKERFILEPATH_CORE)/$(DOCKERFILENAME_CORE) -t $(DOCKERIMAGENAME_CORE):$(VERSIONTAG) .
|
@$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_CORE)/$(DOCKERFILENAME_CORE) -t $(DOCKERIMAGENAME_CORE):$(VERSIONTAG) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_jobservice:
|
_build_jobservice:
|
||||||
@echo "building jobservice container for photon..."
|
@echo "building jobservice container for photon..."
|
||||||
@$(DOCKERBUILD) -f $(DOCKERFILEPATH_JOBSERVICE)/$(DOCKERFILENAME_JOBSERVICE) -t $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) .
|
@$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_JOBSERVICE)/$(DOCKERFILENAME_JOBSERVICE) -t $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_log:
|
_build_log:
|
||||||
@echo "building log container for photon..."
|
@echo "building log container for photon..."
|
||||||
$(DOCKERBUILD) -f $(DOCKERFILEPATH_LOG)/$(DOCKERFILENAME_LOG) -t $(DOCKERIMAGENAME_LOG):$(VERSIONTAG) .
|
$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_LOG)/$(DOCKERFILENAME_LOG) -t $(DOCKERIMAGENAME_LOG):$(VERSIONTAG) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_clair:
|
_build_clair:
|
||||||
@ -140,7 +142,7 @@ _build_clair:
|
|||||||
cd $(DOCKERFILEPATH_CLAIR) && $(DOCKERFILEPATH_CLAIR)/builder $(CLAIRVERSION) && cd - ; \
|
cd $(DOCKERFILEPATH_CLAIR) && $(DOCKERFILEPATH_CLAIR)/builder $(CLAIRVERSION) && cd - ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
echo "building clair container for photon..." ; \
|
echo "building clair container for photon..." ; \
|
||||||
$(DOCKERBUILD) -f $(DOCKERFILEPATH_CLAIR)/$(DOCKERFILENAME_CLAIR) -t $(DOCKERIMAGENAME_CLAIR):$(CLAIRVERSION)-$(VERSIONTAG) . ; \
|
$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_CLAIR)/$(DOCKERFILENAME_CLAIR) -t $(DOCKERIMAGENAME_CLAIR):$(CLAIRVERSION)-$(VERSIONTAG) . ; \
|
||||||
rm -rf $(DOCKERFILEPATH_CLAIR)/binary; \
|
rm -rf $(DOCKERFILEPATH_CLAIR)/binary; \
|
||||||
echo "Done." ; \
|
echo "Done." ; \
|
||||||
fi
|
fi
|
||||||
@ -155,7 +157,7 @@ _build_clair_adapter:
|
|||||||
cd $(DOCKERFILEPATH_CLAIR_ADAPTER) && $(DOCKERFILEPATH_CLAIR_ADAPTER)/builder $(CLAIRADAPTERVERSION) && cd - ; \
|
cd $(DOCKERFILEPATH_CLAIR_ADAPTER) && $(DOCKERFILEPATH_CLAIR_ADAPTER)/builder $(CLAIRADAPTERVERSION) && cd - ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
echo "building clair adapter container for photon..." ; \
|
echo "building clair adapter container for photon..." ; \
|
||||||
$(DOCKERBUILD) -f $(DOCKERFILEPATH_CLAIR_ADAPTER)/$(DOCKERFILENAME_CLAIR_ADAPTER) -t $(DOCKERIMAGENAME_CLAIR_ADAPTER):$(CLAIRADAPTERVERSION)-$(VERSIONTAG) . ; \
|
$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_CLAIR_ADAPTER)/$(DOCKERFILENAME_CLAIR_ADAPTER) -t $(DOCKERIMAGENAME_CLAIR_ADAPTER):$(CLAIRADAPTERVERSION)-$(VERSIONTAG) . ; \
|
||||||
rm -rf $(DOCKERFILEPATH_CLAIR_ADAPTER)/binary; \
|
rm -rf $(DOCKERFILEPATH_CLAIR_ADAPTER)/binary; \
|
||||||
echo "Done." ; \
|
echo "Done." ; \
|
||||||
fi
|
fi
|
||||||
@ -169,14 +171,14 @@ _build_chart_server:
|
|||||||
cd $(DOCKERFILEPATH_CHART_SERVER) && $(DOCKERFILEPATH_CHART_SERVER)/builder $(GOBUILDIMAGE) $(CHART_SERVER_CODE_BASE) $(CHARTMUSEUMVERSION) $(CHART_SERVER_MAIN_PATH) $(CHART_SERVER_BIN_NAME) && cd - ; \
|
cd $(DOCKERFILEPATH_CHART_SERVER) && $(DOCKERFILEPATH_CHART_SERVER)/builder $(GOBUILDIMAGE) $(CHART_SERVER_CODE_BASE) $(CHARTMUSEUMVERSION) $(CHART_SERVER_MAIN_PATH) $(CHART_SERVER_BIN_NAME) && cd - ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
echo "building chartmuseum container for photon..." ; \
|
echo "building chartmuseum container for photon..." ; \
|
||||||
$(DOCKERBUILD) -f $(DOCKERFILEPATH_CHART_SERVER)/$(DOCKERFILENAME_CHART_SERVER) -t $(DOCKERIMAGENAME_CHART_SERVER):$(CHARTMUSEUMVERSION)-$(VERSIONTAG) . ; \
|
$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_CHART_SERVER)/$(DOCKERFILENAME_CHART_SERVER) -t $(DOCKERIMAGENAME_CHART_SERVER):$(CHARTMUSEUMVERSION)-$(VERSIONTAG) . ; \
|
||||||
rm -rf $(DOCKERFILEPATH_CHART_SERVER)/binary; \
|
rm -rf $(DOCKERFILEPATH_CHART_SERVER)/binary; \
|
||||||
echo "Done." ; \
|
echo "Done." ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_build_nginx:
|
_build_nginx:
|
||||||
@echo "building nginx container for photon..."
|
@echo "building nginx container for photon..."
|
||||||
@$(DOCKERBUILD) -f $(DOCKERFILEPATH_NGINX)/$(DOCKERFILENAME_NGINX) -t $(DOCKERIMAGENAME_NGINX):$(NGINXVERSION) .
|
@$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_NGINX)/$(DOCKERFILENAME_NGINX) -t $(DOCKERIMAGENAME_NGINX):$(NGINXVERSION) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_notary:
|
_build_notary:
|
||||||
@ -189,8 +191,8 @@ _build_notary:
|
|||||||
cd $(DOCKERFILEPATH_NOTARY) && $(DOCKERFILEPATH_NOTARY)/builder $(NOTARYVERSION) $(NOTARYMIGRATEVERSION) && cd - ; \
|
cd $(DOCKERFILEPATH_NOTARY) && $(DOCKERFILEPATH_NOTARY)/builder $(NOTARYVERSION) $(NOTARYMIGRATEVERSION) && cd - ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
echo "building notary container for photon..."; \
|
echo "building notary container for photon..."; \
|
||||||
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-signer && $(DOCKERBUILD) -f $(DOCKERFILEPATH_NOTARY)/$(DOCKERFILENAME_NOTARYSIGNER) -t $(DOCKERIMAGENAME_NOTARYSIGNER):$(NOTARYVERSION)-$(VERSIONTAG) . ; \
|
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-signer && $(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_NOTARYSIGNER)/$(DOCKERFILENAME_NOTARYSIGNER) -t $(DOCKERIMAGENAME_NOTARYSIGNER):$(NOTARYVERSION)-$(VERSIONTAG) . ; \
|
||||||
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-server && $(DOCKERBUILD) -f $(DOCKERFILEPATH_NOTARY)/$(DOCKERFILENAME_NOTARYSERVER) -t $(DOCKERIMAGENAME_NOTARYSERVER):$(NOTARYVERSION)-$(VERSIONTAG) . ; \
|
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-server && $(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_NOTARYSERVER)/$(DOCKERFILENAME_NOTARYSERVER) -t $(DOCKERIMAGENAME_NOTARYSERVER):$(NOTARYVERSION)-$(VERSIONTAG) . ; \
|
||||||
rm -rf $(DOCKERFILEPATH_NOTARY)/binary; \
|
rm -rf $(DOCKERFILEPATH_NOTARY)/binary; \
|
||||||
echo "Done."; \
|
echo "Done."; \
|
||||||
fi
|
fi
|
||||||
@ -203,24 +205,24 @@ _build_registry:
|
|||||||
cd $(DOCKERFILEPATH_REG) && $(DOCKERFILEPATH_REG)/builder $(REGISTRY_SRC_TAG) && cd - ; \
|
cd $(DOCKERFILEPATH_REG) && $(DOCKERFILEPATH_REG)/builder $(REGISTRY_SRC_TAG) && cd - ; \
|
||||||
fi
|
fi
|
||||||
@echo "building registry container for photon..."
|
@echo "building registry container for photon..."
|
||||||
@chmod 655 $(DOCKERFILEPATH_REG)/binary/registry && $(DOCKERBUILD) -f $(DOCKERFILEPATH_REG)/$(DOCKERFILENAME_REG) -t $(DOCKERIMAGENAME_REG):$(REGISTRYVERSION)-$(VERSIONTAG) .
|
@chmod 655 $(DOCKERFILEPATH_REG)/binary/registry && $(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_REG)/$(DOCKERFILENAME_REG) -t $(DOCKERIMAGENAME_REG):$(REGISTRYVERSION)-$(VERSIONTAG) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_registryctl:
|
_build_registryctl:
|
||||||
@echo "building registry controller for photon..."
|
@echo "building registry controller for photon..."
|
||||||
@$(DOCKERBUILD) -f $(DOCKERFILEPATH_REGISTRYCTL)/$(DOCKERFILENAME_REGISTRYCTL) -t $(DOCKERIMAGENAME_REGISTRYCTL):$(VERSIONTAG) .
|
@$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_REGISTRYCTL)/$(DOCKERFILENAME_REGISTRYCTL) -t $(DOCKERIMAGENAME_REGISTRYCTL):$(VERSIONTAG) .
|
||||||
@rm -rf $(DOCKERFILEPATH_REG)/binary
|
@rm -rf $(DOCKERFILEPATH_REG)/binary
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_redis:
|
_build_redis:
|
||||||
@echo "building redis container for photon..."
|
@echo "building redis container for photon..."
|
||||||
@$(DOCKERBUILD) -f $(DOCKERFILEPATH_REDIS)/$(DOCKERFILENAME_REDIS) -t $(DOCKERIMAGENAME_REDIS):$(REDISVERSION) .
|
@$(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_REDIS)/$(DOCKERFILENAME_REDIS) -t $(DOCKERIMAGENAME_REDIS):$(REDISVERSION) .
|
||||||
@echo "Done."
|
@echo "Done."
|
||||||
|
|
||||||
_build_migrator:
|
_build_migrator:
|
||||||
@if [ "$(MIGRATORFLAG)" = "true" ] ; then \
|
@if [ "$(MIGRATORFLAG)" = "true" ] ; then \
|
||||||
echo "building db migrator container for photon..."; \
|
echo "building db migrator container for photon..."; \
|
||||||
cd $(DOCKERFILEPATH_MIGRATOR) && $(DOCKERBUILD) -f $(DOCKERFILEPATH_MIGRATOR)/$(DOCKERFILENAME_MIGRATOR) -t $(DOCKERIMAGENAME_MIGRATOR):$(MIGRATORVERSION) . ; \
|
cd $(DOCKERFILEPATH_MIGRATOR) && $(DOCKERBUILD) --build-arg harbor_base_image_version=$(BASEIMAGETAG) -f $(DOCKERFILEPATH_MIGRATOR)/$(DOCKERFILENAME_MIGRATOR) -t $(DOCKERIMAGENAME_MIGRATOR):$(MIGRATORVERSION) . ; \
|
||||||
echo "Done."; \
|
echo "Done."; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-chartserver-base:$harbor_base_image_version
|
||||||
RUN tdnf install -y shadow sudo >>/dev/null\
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 chart \
|
|
||||||
&& useradd --no-log-init -m -g 10000 -u 10000 chart
|
|
||||||
|
|
||||||
COPY ./make/photon/chartserver/binary/chartm /home/chart/
|
COPY ./make/photon/chartserver/binary/chartm /home/chart/
|
||||||
COPY ./make/photon/chartserver/docker-entrypoint.sh /home/chart/
|
COPY ./make/photon/chartserver/docker-entrypoint.sh /home/chart/
|
||||||
|
6
make/photon/chartserver/Dockerfile.base
Normal file
6
make/photon/chartserver/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install -y shadow sudo >>/dev/null\
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& groupadd -r -g 10000 chart \
|
||||||
|
&& useradd --no-log-init -m -g 10000 -u 10000 chart
|
@ -1,10 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-clair-adapter-base:${harbor_base_image_version}
|
||||||
RUN tdnf install -y sudo >>/dev/null\
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& mkdir /clair-adapter/ \
|
|
||||||
&& groupadd -r -g 10000 clair-adapter \
|
|
||||||
&& useradd --no-log-init -m -r -g 10000 -u 10000 clair-adapter
|
|
||||||
|
|
||||||
COPY ./make/photon/clair-adapter/binary/harbor-scanner-clair /clair-adapter/clair-adapter
|
COPY ./make/photon/clair-adapter/binary/harbor-scanner-clair /clair-adapter/clair-adapter
|
||||||
|
|
||||||
|
7
make/photon/clair-adapter/Dockerfile.base
Normal file
7
make/photon/clair-adapter/Dockerfile.base
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install -y sudo >>/dev/null\
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& mkdir /clair-adapter/ \
|
||||||
|
&& groupadd -r -g 10000 clair-adapter \
|
||||||
|
&& useradd --no-log-init -m -r -g 10000 -u 10000 clair-adapter
|
@ -1,9 +1,6 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-clair-base:${harbor_base_image_version}
|
||||||
|
|
||||||
RUN tdnf install -y git shadow sudo rpm xz python-xml >>/dev/null\
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 clair \
|
|
||||||
&& useradd --no-log-init -m -g 10000 -u 10000 clair
|
|
||||||
COPY ./make/photon/clair/binary/clair /home/clair/
|
COPY ./make/photon/clair/binary/clair /home/clair/
|
||||||
COPY ./make/photon/clair/docker-entrypoint.sh /home/clair/
|
COPY ./make/photon/clair/docker-entrypoint.sh /home/clair/
|
||||||
COPY ./make/photon/clair/dumb-init /home/clair/
|
COPY ./make/photon/clair/dumb-init /home/clair/
|
||||||
|
6
make/photon/clair/Dockerfile.base
Normal file
6
make/photon/clair/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install -y git shadow sudo rpm xz python-xml >>/dev/null\
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& groupadd -r -g 10000 clair \
|
||||||
|
&& useradd --no-log-init -m -g 10000 -u 10000 clair
|
@ -1,9 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-core-base:${harbor_base_image_version}
|
||||||
RUN tdnf install sudo tzdata -y >> /dev/null \
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \
|
|
||||||
&& mkdir /harbor/
|
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail -s http://127.0.0.1:8080/api/ping || exit 1
|
HEALTHCHECK CMD curl --fail -s http://127.0.0.1:8080/api/ping || exit 1
|
||||||
COPY ./make/photon/core/harbor_core /harbor/
|
COPY ./make/photon/core/harbor_core /harbor/
|
||||||
|
6
make/photon/core/Dockerfile.base
Normal file
6
make/photon/core/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install sudo tzdata -y >> /dev/null \
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \
|
||||||
|
&& mkdir /harbor/
|
@ -1,20 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-db-base:${harbor_base_image_version}
|
||||||
ENV PGDATA /var/lib/postgresql/data
|
|
||||||
|
|
||||||
RUN tdnf install -y shadow gzip postgresql >> /dev/null\
|
|
||||||
&& groupadd -r postgres --gid=999 \
|
|
||||||
&& useradd -m -r -g postgres --uid=999 postgres \
|
|
||||||
&& mkdir -p /docker-entrypoint-initdb.d \
|
|
||||||
&& mkdir -p /run/postgresql \
|
|
||||||
&& chown -R postgres:postgres /run/postgresql \
|
|
||||||
&& chmod 2777 /run/postgresql \
|
|
||||||
&& 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 \
|
|
||||||
&& tdnf clean all
|
|
||||||
|
|
||||||
RUN tdnf erase -y toybox && tdnf install -y util-linux net-tools
|
|
||||||
|
|
||||||
VOLUME /var/lib/postgresql/data
|
VOLUME /var/lib/postgresql/data
|
||||||
|
|
||||||
|
17
make/photon/db/Dockerfile.base
Normal file
17
make/photon/db/Dockerfile.base
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
ENV PGDATA /var/lib/postgresql/data
|
||||||
|
|
||||||
|
RUN tdnf install -y shadow gzip postgresql >> /dev/null\
|
||||||
|
&& groupadd -r postgres --gid=999 \
|
||||||
|
&& useradd -m -r -g postgres --uid=999 postgres \
|
||||||
|
&& mkdir -p /docker-entrypoint-initdb.d \
|
||||||
|
&& mkdir -p /run/postgresql \
|
||||||
|
&& chown -R postgres:postgres /run/postgresql \
|
||||||
|
&& chmod 2777 /run/postgresql \
|
||||||
|
&& 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 \
|
||||||
|
&& tdnf clean all
|
||||||
|
|
||||||
|
RUN tdnf erase -y toybox && tdnf install -y util-linux net-tools
|
@ -1,8 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-jobservice-base:${harbor_base_image_version}
|
||||||
RUN tdnf install sudo tzdata -y >> /dev/null \
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor
|
|
||||||
|
|
||||||
COPY ./make/photon/jobservice/harbor_jobservice /harbor/
|
COPY ./make/photon/jobservice/harbor_jobservice /harbor/
|
||||||
|
|
||||||
|
5
make/photon/jobservice/Dockerfile.base
Normal file
5
make/photon/jobservice/Dockerfile.base
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install sudo tzdata -y >> /dev/null \
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor
|
@ -1,9 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-log-base:${harbor_base_image_version}
|
||||||
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
|
|
||||||
|
|
||||||
COPY ./make/photon/log/rsyslog.conf /etc/rsyslog.conf
|
COPY ./make/photon/log/rsyslog.conf /etc/rsyslog.conf
|
||||||
|
|
||||||
|
6
make/photon/log/Dockerfile.base
Normal file
6
make/photon/log/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
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
|
@ -1,10 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-nginx-base:${harbor_base_image_version}
|
||||||
RUN tdnf install sudo nginx -y >> /dev/null\
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 nginx && useradd --no-log-init -r -g 10000 -u 10000 nginx \
|
|
||||||
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
|
||||||
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
|
||||||
|
|
||||||
VOLUME /var/cache/nginx /var/log/nginx /run
|
VOLUME /var/cache/nginx /var/log/nginx /run
|
||||||
|
|
||||||
|
7
make/photon/nginx/Dockerfile.base
Normal file
7
make/photon/nginx/Dockerfile.base
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install sudo nginx -y >> /dev/null\
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& groupadd -r -g 10000 nginx && useradd --no-log-init -r -g 10000 -u 10000 nginx \
|
||||||
|
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||||
|
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
@ -1,9 +1,6 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-notary-server-base:${harbor_base_image_version}
|
||||||
RUN tdnf install -y shadow sudo \
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 notary \
|
|
||||||
&& useradd --no-log-init -r -g 10000 -u 10000 notary
|
|
||||||
COPY ./make/photon/notary/migrate-patch /bin/migrate-patch
|
COPY ./make/photon/notary/migrate-patch /bin/migrate-patch
|
||||||
COPY ./make/photon/notary/binary/notary-server /bin/notary-server
|
COPY ./make/photon/notary/binary/notary-server /bin/notary-server
|
||||||
COPY ./make/photon/notary/binary/migrate /bin/migrate
|
COPY ./make/photon/notary/binary/migrate /bin/migrate
|
6
make/photon/notary-server/Dockerfile.base
Normal file
6
make/photon/notary-server/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
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
|
@ -1,9 +1,6 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-notary-signer-base:${harbor_base_image_version}
|
||||||
|
|
||||||
RUN tdnf install -y shadow sudo \
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 notary \
|
|
||||||
&& useradd --no-log-init -r -g 10000 -u 10000 notary
|
|
||||||
COPY ./make/photon/notary/migrate-patch /bin/migrate-patch
|
COPY ./make/photon/notary/migrate-patch /bin/migrate-patch
|
||||||
COPY ./make/photon/notary/binary/notary-signer /bin/notary-signer
|
COPY ./make/photon/notary/binary/notary-signer /bin/notary-signer
|
||||||
COPY ./make/photon/notary/binary/migrate /bin/migrate
|
COPY ./make/photon/notary/binary/migrate /bin/migrate
|
6
make/photon/notary-signer/Dockerfile.base
Normal file
6
make/photon/notary-signer/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
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
|
@ -1,3 +1,4 @@
|
|||||||
|
ARG harbor_base_image_version
|
||||||
FROM node:10.15.0 as nodeportal
|
FROM node:10.15.0 as nodeportal
|
||||||
|
|
||||||
WORKDIR /build_dir
|
WORKDIR /build_dir
|
||||||
@ -22,8 +23,7 @@ RUN ls -la \
|
|||||||
&& npm run link_lib \
|
&& npm run link_lib \
|
||||||
&& node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --prod
|
&& node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --prod
|
||||||
|
|
||||||
|
FROM goharbor/harbor-portal-base:${harbor_base_image_version}
|
||||||
FROM photon:2.0
|
|
||||||
|
|
||||||
COPY --from=nodeportal /build_dir/dist /usr/share/nginx/html
|
COPY --from=nodeportal /build_dir/dist /usr/share/nginx/html
|
||||||
COPY --from=nodeportal /build_dir/swagger.yaml /usr/share/nginx/html
|
COPY --from=nodeportal /build_dir/swagger.yaml /usr/share/nginx/html
|
||||||
@ -32,13 +32,6 @@ COPY --from=nodeportal /build_dir/LICENSE /usr/share/nginx/html
|
|||||||
|
|
||||||
COPY make/photon/portal/nginx.conf /etc/nginx/nginx.conf
|
COPY make/photon/portal/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
RUN tdnf install -y nginx sudo >> /dev/null \
|
|
||||||
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
|
||||||
&& ln -sf /dev/stderr /var/log/nginx/error.log \
|
|
||||||
&& groupadd -r -g 10000 nginx && useradd --no-log-init -r -g 10000 -u 10000 nginx \
|
|
||||||
&& chown -R nginx:nginx /etc/nginx \
|
|
||||||
&& tdnf clean all
|
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
VOLUME /var/cache/nginx /var/log/nginx /run
|
VOLUME /var/cache/nginx /var/log/nginx /run
|
||||||
|
|
||||||
|
8
make/photon/portal/Dockerfile.base
Normal file
8
make/photon/portal/Dockerfile.base
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install -y nginx sudo >> /dev/null \
|
||||||
|
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||||
|
&& ln -sf /dev/stderr /var/log/nginx/error.log \
|
||||||
|
&& groupadd -r -g 10000 nginx && useradd --no-log-init -r -g 10000 -u 10000 nginx \
|
||||||
|
&& chown -R nginx:nginx /etc/nginx \
|
||||||
|
&& tdnf clean all
|
@ -1,4 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-prepare-base:${harbor_base_image_version}
|
||||||
|
|
||||||
ENV LANG en_US.UTF-8
|
ENV LANG en_US.UTF-8
|
||||||
|
|
||||||
@ -6,10 +7,6 @@ WORKDIR /usr/src/app
|
|||||||
|
|
||||||
RUN mkdir -p /harbor_make
|
RUN mkdir -p /harbor_make
|
||||||
|
|
||||||
RUN tdnf install -y python3 \
|
|
||||||
&& tdnf install -y python3-pip
|
|
||||||
RUN pip3 install pipenv==2018.11.26
|
|
||||||
|
|
||||||
COPY make/photon/prepare /usr/src/app
|
COPY make/photon/prepare /usr/src/app
|
||||||
RUN set -ex && pipenv install --deploy --system
|
RUN set -ex && pipenv install --deploy --system
|
||||||
|
|
||||||
|
5
make/photon/prepare/Dockerfile.base
Normal file
5
make/photon/prepare/Dockerfile.base
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install -y python3 \
|
||||||
|
&& tdnf install -y python3-pip
|
||||||
|
RUN pip3 install pipenv==2018.11.26
|
@ -1,6 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-redis-base:${harbor_base_image_version}
|
||||||
RUN tdnf install -y redis sudo
|
|
||||||
|
|
||||||
VOLUME /var/lib/redis
|
VOLUME /var/lib/redis
|
||||||
WORKDIR /var/lib/redis
|
WORKDIR /var/lib/redis
|
||||||
|
3
make/photon/redis/Dockerfile.base
Normal file
3
make/photon/redis/Dockerfile.base
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install -y redis sudo
|
@ -1,12 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-registry-base:${harbor_base_image_version}
|
||||||
LABEL maintainer="wangyan@vmware.com"
|
|
||||||
|
|
||||||
# The original script in the docker offical registry image.
|
|
||||||
RUN tdnf install sudo -y >> /dev/null\
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& mkdir -p /etc/registry \
|
|
||||||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor
|
|
||||||
|
|
||||||
COPY ./make/photon/common/install_cert.sh /home/harbor
|
COPY ./make/photon/common/install_cert.sh /home/harbor
|
||||||
COPY ./make/photon/registry/entrypoint.sh /home/harbor
|
COPY ./make/photon/registry/entrypoint.sh /home/harbor
|
||||||
|
6
make/photon/registry/Dockerfile.base
Normal file
6
make/photon/registry/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install sudo -y >> /dev/null\
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& mkdir -p /etc/registry \
|
||||||
|
&& groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor
|
@ -1,11 +1,5 @@
|
|||||||
FROM photon:2.0
|
ARG harbor_base_image_version
|
||||||
|
FROM goharbor/harbor-registryctl-base:${harbor_base_image_version}
|
||||||
Label maintainer="wangyan@vmware.com"
|
|
||||||
|
|
||||||
RUN tdnf install sudo -y >> /dev/null \
|
|
||||||
&& tdnf clean all \
|
|
||||||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor \
|
|
||||||
&& mkdir -p /etc/registry
|
|
||||||
|
|
||||||
COPY ./make/photon/common/install_cert.sh /home/harbor
|
COPY ./make/photon/common/install_cert.sh /home/harbor
|
||||||
COPY ./make/photon/registry/binary/registry /usr/bin
|
COPY ./make/photon/registry/binary/registry /usr/bin
|
||||||
|
6
make/photon/registryctl/Dockerfile.base
Normal file
6
make/photon/registryctl/Dockerfile.base
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM photon:2.0
|
||||||
|
|
||||||
|
RUN tdnf install sudo -y >> /dev/null \
|
||||||
|
&& tdnf clean all \
|
||||||
|
&& groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor \
|
||||||
|
&& mkdir -p /etc/registry
|
@ -19,7 +19,7 @@ sleep 2
|
|||||||
sudo -E env "PATH=$PATH" make go_check
|
sudo -E env "PATH=$PATH" make go_check
|
||||||
sudo ./tests/hostcfg.sh
|
sudo ./tests/hostcfg.sh
|
||||||
sudo ./tests/generateCerts.sh
|
sudo ./tests/generateCerts.sh
|
||||||
sudo make -f make/photon/Makefile _build_db _build_registry _build_prepare -e VERSIONTAG=dev -e REGISTRYVERSION=${REG_VERSION}
|
sudo make -f make/photon/Makefile _build_db _build_registry _build_prepare -e VERSIONTAG=dev -e REGISTRYVERSION=${REG_VERSION} -e BASEIMAGETAG=dev
|
||||||
sudo MAKEPATH=$(pwd)/make ./make/prepare
|
sudo MAKEPATH=$(pwd)/make ./make/prepare
|
||||||
sudo mkdir -p "/data/redis"
|
sudo mkdir -p "/data/redis"
|
||||||
sudo mkdir -p /etc/core/ca/ && sudo mv ./tests/ca.crt /etc/core/ca/
|
sudo mkdir -p /etc/core/ca/ && sudo mv ./tests/ca.crt /etc/core/ca/
|
||||||
|
Loading…
Reference in New Issue
Block a user