Skip to content

Commit

Permalink
Harbor Upgrade code changes for 2.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tdv authored and tdv committed Oct 17, 2023
1 parent 77903fa commit 197df7c
Show file tree
Hide file tree
Showing 27 changed files with 48 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
GODEP=$(GOTEST) -i
GOFMT=gofmt -w
GOBUILDIMAGE=golang:1.19.4
GOBUILDIMAGE=harbor-repo.vmware.com/dockerhub-proxy-cache/golang:1.19.4
GOBUILDPATHINCONTAINER=/harbor

# go build
Expand Down
38 changes: 19 additions & 19 deletions make/photon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DOCKERRMIMAGE=$(DOCKERCMD) rmi
DOCKERIMAGES=$(DOCKERCMD) images
IMAGENAMESPACE=goharbor
BASEIMAGENAMESPACE=goharbor
DOCKERHUB=harbor-repo.vmware.com/dockerhub-proxy-cache/

# pushimage
PUSHSCRIPTPATH=$(MAKEPATH)
Expand Down Expand Up @@ -128,37 +129,37 @@ CHART_SERVER_BIN_NAME=chartm
_build_prepare:
@$(call _build_base,$(PREPARE),$(DOCKERFILEPATH_PREPARE))
@echo "building prepare container for photon..."
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_PREPARE)/$(DOCKERFILENAME_PREPARE) -t $(DOCKERIMAGENAME_PREPARE):$(VERSIONTAG) .
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_PREPARE)/$(DOCKERFILENAME_PREPARE) -t $(DOCKERIMAGENAME_PREPARE):$(VERSIONTAG) .
@echo "Done."

_build_db:
@$(call _build_base,$(DB),$(DOCKERFILEPATH_DB))
@echo "building db container for photon..."
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_DB)/$(DOCKERFILENAME_DB) -t $(DOCKERIMAGENAME_DB):$(VERSIONTAG) .
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_DB)/$(DOCKERFILENAME_DB) -t $(DOCKERIMAGENAME_DB):$(VERSIONTAG) .
@echo "Done."

_build_portal:
@$(call _build_base,$(PORTAL),$(DOCKERFILEPATH_PORTAL))
@echo "building portal container for photon..."
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) --build-arg npm_registry=$(NPM_REGISTRY) -f $(DOCKERFILEPATH_PORTAL)/$(DOCKERFILENAME_PORTAL) -t $(DOCKERIMAGENAME_PORTAL):$(VERSIONTAG) .
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) --build-arg npm_registry=$(NPM_REGISTRY) -f $(DOCKERFILEPATH_PORTAL)/$(DOCKERFILENAME_PORTAL) -t $(DOCKERIMAGENAME_PORTAL):$(VERSIONTAG) .
@echo "Done."

_build_core:
@$(call _build_base,$(CORE),$(DOCKERFILEPATH_CORE))
@echo "building core container for photon..."
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_CORE)/$(DOCKERFILENAME_CORE) -t $(DOCKERIMAGENAME_CORE):$(VERSIONTAG) .
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_CORE)/$(DOCKERFILENAME_CORE) -t $(DOCKERIMAGENAME_CORE):$(VERSIONTAG) .
@echo "Done."

_build_jobservice:
@$(call _build_base,$(JOBSERVICE),$(DOCKERFILEPATH_JOBSERVICE))
@echo "building jobservice container for photon..."
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_JOBSERVICE)/$(DOCKERFILENAME_JOBSERVICE) -t $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) .
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_JOBSERVICE)/$(DOCKERFILENAME_JOBSERVICE) -t $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) .
@echo "Done."

_build_log:
@$(call _build_base,$(LOG),$(DOCKERFILEPATH_LOG))
@echo "building log container for photon..."
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_LOG)/$(DOCKERFILENAME_LOG) -t $(DOCKERIMAGENAME_LOG):$(VERSIONTAG) .
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_LOG)/$(DOCKERFILENAME_LOG) -t $(DOCKERIMAGENAME_LOG):$(VERSIONTAG) .
@echo "Done."

_build_trivy_adapter:
Expand All @@ -176,7 +177,7 @@ _build_trivy_adapter:
fi ; \
echo "Building Trivy adapter container for photon..." ; \
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) \
--build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) \
--build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) \
--build-arg trivy_version=$(TRIVYVERSION) \
-f $(DOCKERFILEPATH_TRIVY_ADAPTER)/$(DOCKERFILENAME_TRIVY_ADAPTER) \
-t $(DOCKERIMAGENAME_TRIVY_ADAPTER):$(VERSIONTAG) . ; \
Expand All @@ -194,15 +195,15 @@ _build_chart_server:
cd $(DOCKERFILEPATH_CHART_SERVER) && $(DOCKERFILEPATH_CHART_SERVER)/builder $(GOBUILDIMAGE) $(CHART_SERVER_CODE_BASE) $(CHARTMUSEUM_SRC_TAG) $(CHART_SERVER_MAIN_PATH) $(CHART_SERVER_BIN_NAME) && cd - ; \
fi ; \
echo "building chartmuseum container for photon..." ; \
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_CHART_SERVER)/$(DOCKERFILENAME_CHART_SERVER) -t $(DOCKERIMAGENAME_CHART_SERVER):$(VERSIONTAG) . ; \
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_CHART_SERVER)/$(DOCKERFILENAME_CHART_SERVER) -t $(DOCKERIMAGENAME_CHART_SERVER):$(VERSIONTAG) . ; \
rm -rf $(DOCKERFILEPATH_CHART_SERVER)/binary; \
echo "Done." ; \
fi

_build_nginx:
@$(call _build_base,$(NGINX),$(DOCKERFILEPATH_NGINX))
@echo "building nginx container for photon..."
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_NGINX)/$(DOCKERFILENAME_NGINX) -t $(DOCKERIMAGENAME_NGINX):$(VERSIONTAG) .
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_NGINX)/$(DOCKERFILENAME_NGINX) -t $(DOCKERIMAGENAME_NGINX):$(VERSIONTAG) .
@echo "Done."

_build_notary:
Expand All @@ -217,8 +218,8 @@ _build_notary:
cd $(DOCKERFILEPATH_NOTARY) && $(DOCKERFILEPATH_NOTARY)/builder $(NOTARYVERSION) $(NOTARYMIGRATEVERSION) && cd - ; \
fi ; \
echo "building notary container for photon..."; \
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-signer && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_NOTARYSIGNER)/$(DOCKERFILENAME_NOTARYSIGNER) -t $(DOCKERIMAGENAME_NOTARYSIGNER):$(VERSIONTAG) . ; \
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-server && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_NOTARYSERVER)/$(DOCKERFILENAME_NOTARYSERVER) -t $(DOCKERIMAGENAME_NOTARYSERVER):$(VERSIONTAG) . ; \
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-signer && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_NOTARYSIGNER)/$(DOCKERFILENAME_NOTARYSIGNER) -t $(DOCKERIMAGENAME_NOTARYSIGNER):$(VERSIONTAG) . ; \
chmod 655 $(DOCKERFILEPATH_NOTARY)/binary/notary-server && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_NOTARYSERVER)/$(DOCKERFILENAME_NOTARYSERVER) -t $(DOCKERIMAGENAME_NOTARYSERVER):$(VERSIONTAG) . ; \
rm -rf $(DOCKERFILEPATH_NOTARY)/binary; \
echo "Done."; \
fi
Expand All @@ -232,31 +233,31 @@ _build_registry:
cd $(DOCKERFILEPATH_REG) && $(DOCKERFILEPATH_REG)/builder $(REGISTRY_SRC_TAG) && cd - ; \
fi
@echo "building registry container for photon..."
@chmod 655 $(DOCKERFILEPATH_REG)/binary/registry && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REG)/$(DOCKERFILENAME_REG) -t $(DOCKERIMAGENAME_REG):$(VERSIONTAG) .
@chmod 655 $(DOCKERFILEPATH_REG)/binary/registry && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REG)/$(DOCKERFILENAME_REG) -t $(DOCKERIMAGENAME_REG):$(VERSIONTAG) .
@echo "Done."

_build_registryctl:
@$(call _build_base,$(REGISTRYCTL),$(DOCKERFILEPATH_REGISTRYCTL))
@echo "building registry controller for photon..."
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REGISTRYCTL)/$(DOCKERFILENAME_REGISTRYCTL) -t $(DOCKERIMAGENAME_REGISTRYCTL):$(VERSIONTAG) .
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REGISTRYCTL)/$(DOCKERFILENAME_REGISTRYCTL) -t $(DOCKERIMAGENAME_REGISTRYCTL):$(VERSIONTAG) .
@rm -rf $(DOCKERFILEPATH_REG)/binary
@echo "Done."

_build_redis:
@$(call _build_base,$(REDIS),$(DOCKERFILEPATH_REDIS))
@echo "building redis container for photon..."
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REDIS)/$(DOCKERFILENAME_REDIS) -t $(DOCKERIMAGENAME_REDIS):$(VERSIONTAG) .
@$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REDIS)/$(DOCKERFILENAME_REDIS) -t $(DOCKERIMAGENAME_REDIS):$(VERSIONTAG) .
@echo "Done."

_build_standalone_db_migrator:
@echo "building standalone db migrator image for photon..."
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_STANDALONE_DB_MIGRATOR)/$(DOCKERFILENAME_STANDALONE_DB_MIGRATOR) -t $(DOCKERIMAGENAME_STANDALONE_DB_MIGRATOR):$(VERSIONTAG) .
$(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_STANDALONE_DB_MIGRATOR)/$(DOCKERFILENAME_STANDALONE_DB_MIGRATOR) -t $(DOCKERIMAGENAME_STANDALONE_DB_MIGRATOR):$(VERSIONTAG) .
@echo "Done."

_compile_and_build_exporter:
@$(call _build_base,$(EXPORTER),$(DOCKERFILEPATH_EXPORTER))
@echo "compiling and building image for exporter..."
@$(DOCKERCMD) build --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) --build-arg build_image=$(GOBUILDIMAGE) -f ${DOCKERFILEPATH_EXPORTER}/${DOCKERFILENAME_EXPORTER} -t $(DOCKERIMAGENAME_EXPORTER):$(VERSIONTAG) .
@$(DOCKERCMD) build --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(DOCKERHUB)$(BASEIMAGENAMESPACE) --build-arg build_image=$(GOBUILDIMAGE) -f ${DOCKERFILEPATH_EXPORTER}/${DOCKERFILENAME_EXPORTER} -t $(DOCKERIMAGENAME_EXPORTER):$(VERSIONTAG) .
@echo "Done."

define _extract_archive
Expand All @@ -280,9 +281,9 @@ define _build_base
if [ "$(1)" = "db" ] && [ "$(BUILD_PG96)" = "true" ]; then \
echo "build pg96 rpm package." ; \
cd $(DOCKERFILEPATH)/db && $(DOCKERFILEPATH)/db/rpm_builder.sh && cd - ; \
$(DOCKERBUILD) --pull --no-cache -f $(DOCKERFILEPATH)/db/Dockerfile.pg96 -t $(BASEIMAGENAMESPACE)/harbor-db-base:$(BASEIMAGETAG) --label base-build-date=$(TIMESTAMP) . ; \
$(DOCKERBUILD) --pull --no-cache -f $(DOCKERFILEPATH)/db/Dockerfile.pg96 -t $(DOCKERHUB)$(BASEIMAGENAMESPACE)/harbor-db-base:$(BASEIMAGETAG) --label base-build-date=$(TIMESTAMP) . ; \
else \
$(DOCKERBUILD) -f $(2)/Dockerfile.base -t $(BASEIMAGENAMESPACE)/harbor-$(1)-base:$(BASEIMAGETAG) --label base-build-date=$(TIMESTAMP) . ;\
$(DOCKERBUILD) -f $(2)/Dockerfile.base -t $(DOCKERHUB)$(BASEIMAGENAMESPACE)/harbor-$(1)-base:$(BASEIMAGETAG) --label base-build-date=$(TIMESTAMP) . ;\
fi ;\
if [ "$(PUSHBASEIMAGE)" = "true" ] ; then \
$(PUSHSCRIPTPATH)/$(PUSHSCRIPTNAME) $(BASEIMAGENAMESPACE)/harbor-$(1)-base:$(BASEIMAGETAG) $(REGISTRYUSER) $(REGISTRYPASSWORD) docker.io $(PULL_BASE_FROM_DOCKERHUB) || exit 1; \
Expand All @@ -303,4 +304,3 @@ cleanimage:

.PHONY: clean
clean: cleanimage

2 changes: 1 addition & 1 deletion make/photon/chartserver/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y shadow >>/dev/null\
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/core/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y tzdata shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/db/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

ENV PGDATA /var/lib/postgresql/data

Expand Down
2 changes: 1 addition & 1 deletion make/photon/db/Dockerfile.pg96
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

ENV PGDATA /var/lib/postgresql/data

Expand Down
2 changes: 1 addition & 1 deletion make/photon/exporter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG build_image
ARG harbor_base_image_version
ARG harbor_base_namespace

FROM ${build_image} AS build
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/${build_image} AS build

ENV CGO_ENABLED=0
ENV GOOS=linux
Expand Down
2 changes: 1 addition & 1 deletion make/photon/exporter/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y tzdata shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/jobservice/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y tzdata shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/log/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY ./make/photon/log/rsyslog.conf /etc/rsyslog.conf
COPY ./make/photon/log/rsyslog_docker.conf /etc/rsyslog.d/

# remove the original "logrotate" in directory "/etc/cron.daily/"
# and copy the customized one to directory "/etc/cron.hourly/"
# and copy the customized one to directory "/etc/cron.hourly/"
# to run logrotate hourly
RUN rm /etc/cron.daily/logrotate
COPY ./make/photon/log/logrotate /etc/cron.hourly/
Expand Down
2 changes: 1 addition & 1 deletion make/photon/log/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo >> /dev/null\
&& mkdir /var/spool/rsyslog \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/nginx/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y nginx shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/notary-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ COPY ./make/photon/notary/binary/migrations/ /migrations/
RUN chmod +x /bin/notary-server /migrations/migrate.sh /bin/migrate /bin/migrate-patch
ENV SERVICE_NAME=notary_server
USER notary
CMD migrate-patch -database=${DB_URL} && /migrations/migrate.sh && /bin/notary-server -config=/etc/notary/server-config.postgres.json -logf=logfmt
CMD migrate-patch -database=${DB_URL} && /migrations/migrate.sh && /bin/notary-server -config=/etc/notary/server-config.postgres.json -logf=logfmt
2 changes: 1 addition & 1 deletion make/photon/notary-server/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/notary-signer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ COPY ./make/photon/notary/binary/migrations/ /migrations/
RUN chmod +x /bin/notary-signer /migrations/migrate.sh /bin/migrate /bin/migrate-patch
ENV SERVICE_NAME=notary_signer
USER notary
CMD migrate-patch -database=${DB_URL} && /migrations/migrate.sh && /bin/notary-signer -config=/etc/notary/signer-config.postgres.json -logf=logfmt
CMD migrate-patch -database=${DB_URL} && /migrations/migrate.sh && /bin/notary-signer -config=/etc/notary/signer-config.postgres.json -logf=logfmt
2 changes: 1 addition & 1 deletion make/photon/notary-signer/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y shadow >> /dev/null \
&& tdnf clean all \
Expand Down
7 changes: 3 additions & 4 deletions make/photon/notary/binary.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.15
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/golang:1.14.15

ARG NOTARY_VERSION
ARG MIGRATE_VERSION
Expand All @@ -11,11 +11,11 @@ RUN git clone -b $NOTARY_VERSION https://github.com/theupdateframework/notary.gi
WORKDIR /go/src/${NOTARYPKG}

RUN go install -tags pkcs11 \
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" ${NOTARYPKG}/cmd/notary-server
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" ${NOTARYPKG}/cmd/notary-server

RUN go install -tags pkcs11 \
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" ${NOTARYPKG}/cmd/notary-signer
RUN cp -r /go/src/${NOTARYPKG}/migrations/ /
RUN cp -r /go/src/${NOTARYPKG}/migrations/ /

RUN git clone -b $MIGRATE_VERSION https://github.com/golang-migrate/migrate /go/src/${MIGRATEPKG}
WORKDIR /go/src/${MIGRATEPKG}
Expand All @@ -24,4 +24,3 @@ ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb"
ENV SOURCES="file go_bindata github aws_s3 google_cloud_storage"

RUN go install -tags "$DATABASES $SOURCES" -ldflags="-X main.Version=${MIGRATE_VERSION}" ${MIGRATEPKG}/cli && mv /go/bin/cli /go/bin/migrate

3 changes: 1 addition & 2 deletions make/photon/portal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG harbor_base_image_version
ARG harbor_base_namespace
FROM node:16.10.0 as nodeportal
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/node:16.10.0 as nodeportal

WORKDIR /build_dir

Expand Down Expand Up @@ -41,4 +41,3 @@ STOPSIGNAL SIGQUIT
HEALTHCHECK CMD curl --fail -s http://localhost:8080 || curl -k --fail -s https://localhost:8443 || exit 1
USER nginx
CMD ["nginx", "-g", "daemon off;"]

2 changes: 1 addition & 1 deletion make/photon/portal/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y nginx shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/prepare/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ COPY make/photon/prepare /usr/src/app

ENTRYPOINT [ "python3", "main.py" ]

VOLUME ["/harbor_make"]
VOLUME ["/harbor_make"]
2 changes: 1 addition & 1 deletion make/photon/prepare/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y python3 python3-pip python3-PyYAML python3-jinja2 && tdnf clean all
RUN pip3 install pipenv==2022.1.8
Expand Down
2 changes: 1 addition & 1 deletion make/photon/redis/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y redis && tdnf clean all
4 changes: 2 additions & 2 deletions make/photon/registry/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y shadow >> /dev/null \
&& tdnf clean all \
&& mkdir -p /etc/registry \
&& groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor
&& groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor
2 changes: 1 addition & 1 deletion make/photon/registry/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.4
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/golang:1.19.4

ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
ENV BUILDTAGS include_oss include_gcs
Expand Down
2 changes: 1 addition & 1 deletion make/photon/registryctl/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/trivy-adapter/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photon:4.0
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/photon:4.0

RUN tdnf install -y rpm shadow >> /dev/null \
&& tdnf clean all \
Expand Down
2 changes: 1 addition & 1 deletion make/photon/trivy-adapter/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.4
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/golang:1.19.4

ADD . /go/src/github.com/aquasecurity/harbor-scanner-trivy/
WORKDIR /go/src/github.com/aquasecurity/harbor-scanner-trivy/
Expand Down

0 comments on commit 197df7c

Please sign in to comment.