Skip to content

Commit 11991b9

Browse files
committed
feat(harbor): build the Harbor images for amd64 and arm64
Upstream publishes the Harbor v2.15 component images for amd64 only, so every Harbor pod crash-loops with "exec format error" on an arm64 node. The multi-arch build upstream exists on main but is in no release yet, so the package now rebuilds the pinned v2.15.1 release itself: the Go components cross-compile on the build platform, the registry and the Trivy adapter build from the tags upstream's Makefile pins, the Trivy binary is fetched per architecture against its release checksum, and the runtime images keep upstream's photon base, users and entrypoints. The build fails when those registry and Trivy pins, the swagger generator or the golang and node build images no longer match upstream's Makefile at the pinned release, so a version bump cannot pair a new core with an old registry, scanner or toolchain. The portal compiles to static JS, so it lives in its own Dockerfile listed as architecture-neutral in the cross-compile check, and takes the release pin from the main one so both files build the same commit. Because values.yaml now pins the images, `make update` pins the chart release that ships the same Harbor version and fails when its appVersion differs, instead of pulling the newest chart onto old images. Renovate stops proposing tag bumps for the rebuild's build bases, which follow upstream's toolchain for that release. The committed refs stay on the upstream digests until CI stamps the rebuilt ones. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 084ac47 commit 11991b9

7 files changed

Lines changed: 332 additions & 5 deletions

File tree

‎.github/renovate.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@
7272
"groupName": "container image & action digests",
7373
"schedule": ["before 6am on monday"]
7474
},
75+
{
76+
"description": "The Harbor rebuilds reproduce one upstream release, so their build bases follow upstream's Makefile at that tag (GOBUILDIMAGE, NODEBUILDIMAGE) rather than the newest image. A golang tag bump builds Harbor with a toolchain upstream never shipped it with, and a node major breaks the Angular portal build. Tag bumps are disabled here; digest refreshes of the same tag still arrive through the digest group above. Move the tags by hand with HARBOR_VERSION.",
77+
"matchManagers": ["dockerfile"],
78+
"matchFileNames": ["packages/system/harbor/images/**"],
79+
"matchUpdateTypes": ["major", "minor", "patch"],
80+
"enabled": false
81+
},
7582
{
7683
"description": "kubevirt.io/csi-driver is pinned to an untagged pseudo-version commit and publishes no release tags, so Renovate's go datasource returns no-result and the lookup failure lingers on the Dependency Dashboard. Disable it; this module is advanced deliberately alongside the kubevirt-csi-driver image build.",
7784
"matchManagers": ["gomod"],

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ build: build-deps
3737
make -C packages/system/securitygroup-controller image
3838
make -C packages/system/grafana-operator image
3939
make -C packages/system/redis-operator image
40+
make -C packages/system/harbor image
4041
make -C packages/system/opensearch-operator image
4142
make -C packages/core/testing image
4243
make -C packages/core/talos image

‎hack/image-builders-cross-compile.bats‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525

2626
REPO_ROOT="$(cd "$(dirname "${BATS_TEST_FILENAME:-$0}")/.." && pwd)"
2727

28-
# Outputs with no architecture: the console builds static JS; piraeus-server
29-
# builds Java .debs that linstor-server's debian/control declares
30-
# `Architecture: all`.
28+
# Outputs with no architecture: the console and the Harbor portal build static
29+
# JS; piraeus-server builds Java .debs that linstor-server's debian/control
30+
# declares `Architecture: all`.
3131
ARCH_NEUTRAL="packages/system/dashboard/images/console/Containerfile
32+
packages/system/harbor/images/harbor-portal/Dockerfile
3233
packages/system/linstor/images/piraeus-server/Dockerfile"
3334

3435
# One line per stage: "<compiles 0|1> <targets 0|1> <FROM line>".

‎packages/system/harbor/Makefile‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,51 @@
1+
HARBOR_VERSION = $(shell awk -F= '$$1 == "ARG VERSION" {print $$2; exit}' images/harbor/Dockerfile)
2+
HARBOR_COMMIT = $(shell awk -F= '$$1 == "ARG COMMIT" {print $$2; exit}' images/harbor/Dockerfile)
3+
# The chart release that ships HARBOR_VERSION; bump both together.
4+
HARBOR_CHART_VERSION = 1.19.1
5+
16
export NAME=harbor-system
27
export NAMESPACE=cozy-system
38

9+
include ../../../hack/common-envs.mk
410
include ../../../hack/package.mk
511

12+
HARBOR_IMAGES = harbor-core harbor-jobservice harbor-portal harbor-registryctl harbor-exporter registry-photon nginx-photon trivy-adapter-photon
13+
harbor-core_KEY = .harbor.core.image
14+
harbor-jobservice_KEY = .harbor.jobservice.image
15+
harbor-portal_KEY = .harbor.portal.image
16+
harbor-registryctl_KEY = .harbor.registry.controller.image
17+
harbor-exporter_KEY = .harbor.exporter.image
18+
registry-photon_KEY = .harbor.registry.registry.image
19+
nginx-photon_KEY = .harbor.nginx.image
20+
trivy-adapter-photon_KEY = .harbor.trivy.image
21+
22+
.PHONY: test update image
23+
624
test:
725
helm unittest .
826

927
update:
1028
rm -rf charts
1129
helm repo add harbor https://helm.goharbor.io
1230
helm repo update harbor
13-
helm pull harbor/harbor --untar --untardir charts
31+
helm pull harbor/harbor --version $(HARBOR_CHART_VERSION) --untar --untardir charts
32+
# values.yaml pins images built from HARBOR_VERSION, so a chart for another
33+
# Harbor release would silently run on mismatched images.
34+
test "v$$(yq e '.appVersion' charts/harbor/Chart.yaml)" = "$(HARBOR_VERSION)"
35+
36+
# Sequential on purpose: every image stamps the same values.yaml with yq -i.
37+
image:
38+
$(foreach name,$(HARBOR_IMAGES),$(call build-harbor-image,$(name)))
39+
40+
define build-harbor-image
41+
docker buildx build $(if $(filter harbor-portal,$(1)),images/harbor-portal,images/harbor --target $(1)) \
42+
--build-arg VERSION=$(HARBOR_VERSION) --build-arg COMMIT=$(HARBOR_COMMIT) \
43+
$(call image-tags,$(1),$(HARBOR_VERSION)) \
44+
$(call cache-args,$(1)) \
45+
--metadata-file images/$(1).json \
46+
$(BUILDX_ARGS)
47+
REPOSITORY="$(REGISTRY)/$(1)" TAG="$(IMAGE_TAG)@$$(yq e '."containerimage.digest"' images/$(1).json -o json -r)" \
48+
yq -i '$($(1)_KEY).repository = strenv(REPOSITORY) | $($(1)_KEY).tag = strenv(TAG)' values.yaml
49+
rm -f images/$(1).json
50+
51+
endef
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# The portal half of the Harbor rebuild in images/harbor, kept in its own file
2+
# because its build output is static JS with no architecture. The Makefile
3+
# passes VERSION and COMMIT from images/harbor/Dockerfile so both files build
4+
# one pinned release. Follows upstream's make/photon/portal/Dockerfile{,.base}.
5+
#
6+
# Temporary, like images/harbor: deleted together with it once the vendored
7+
# chart moves to an upstream release that publishes arm64 (expected 2.16).
8+
ARG VERSION
9+
ARG COMMIT
10+
11+
FROM --platform=$BUILDPLATFORM node:16.18.0@sha256:3547c98a330a08fb9dbb8b04ac4430f6d21133cb79f21f6cf8283184f523ff83 AS build
12+
ARG VERSION
13+
ARG COMMIT
14+
RUN git clone --branch ${VERSION} --depth 1 https://github.com/goharbor/harbor /harbor \
15+
&& test "$(git -C /harbor rev-parse HEAD)" = "${COMMIT}"
16+
# A VERSION bump must not build the portal with the old node.
17+
RUN grep -qxF "NODEBUILDIMAGE=node:$(node --version | sed 's/^v//')" /harbor/Makefile
18+
WORKDIR /harbor/src/portal
19+
# The postinstall hook generates the API client from ./swagger.yaml.
20+
RUN cp /harbor/api/v2.0/swagger.yaml swagger.yaml \
21+
&& npm install --unsafe-perm \
22+
&& npm run generate-build-timestamp \
23+
&& node --max_old_space_size=2048 node_modules/@angular/cli/bin/ng build --configuration production
24+
RUN npm install [email protected] \
25+
&& node -e "const yaml = require('js-yaml'); const fs = require('fs'); fs.writeFileSync('swagger.json', JSON.stringify(yaml.load(fs.readFileSync('swagger.yaml', 'utf8'))));" \
26+
&& cp /harbor/LICENSE dist/
27+
RUN cd app-swagger-ui && npm install --unsafe-perm && npm run build
28+
29+
FROM goharbor/photon:5.0@sha256:0e06d58615400bf2a3fe7da1175b889e2827969e3ac42e1c4010010770e6a712
30+
RUN tdnf install -y nginx shadow >> /dev/null \
31+
&& tdnf clean all \
32+
&& ln -sf /dev/stdout /var/log/nginx/access.log \
33+
&& ln -sf /dev/stderr /var/log/nginx/error.log \
34+
&& groupmod -g 10000 nginx && usermod -g 10000 -u 10000 -d /home/nginx -s /bin/bash nginx \
35+
&& chown -R nginx:nginx /etc/nginx
36+
COPY --from=build /harbor/src/portal/dist /usr/share/nginx/html
37+
COPY --from=build /harbor/src/portal/swagger.json /usr/share/nginx/html
38+
COPY --from=build /harbor/src/portal/app-swagger-ui/dist /usr/share/nginx/html
39+
VOLUME /var/cache/nginx /var/log/nginx /run
40+
STOPSIGNAL SIGQUIT
41+
USER nginx
42+
CMD ["nginx", "-g", "daemon off;"]
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# Upstream publishes the Harbor v2.15 component images for amd64 only; its
2+
# multi-arch build is on main but in no release yet. This rebuilds the pinned
3+
# release for every platform, one --target per image, following upstream's
4+
# make/photon/<component>/Dockerfile{,.base} and the compile targets of its
5+
# top-level Makefile. The portal is built by images/harbor-portal.
6+
#
7+
# Temporary: once the vendored chart moves to an upstream release that
8+
# publishes arm64 (expected 2.16), delete both Dockerfiles, the image target,
9+
# the image overrides in values.yaml, the build: line in the root Makefile,
10+
# the portal's ARCH_NEUTRAL entry in hack/image-builders-cross-compile.bats
11+
# and the harbor rule in .github/renovate.json, and drop the appVersion check
12+
# from the package's update target, which reads VERSION from this file.
13+
ARG VERSION=v2.15.1
14+
ARG COMMIT=335c05f2b9507b4c7116fe69b84e31ef9f4b91dd
15+
# REGISTRY_SRC_TAG, REGISTRYVERSION, TRIVYADAPTERVERSION, TRIVYVERSION and
16+
# SWAGGER_VERSION in upstream's Makefile at VERSION; the source stage fails
17+
# when they drift.
18+
ARG DISTRIBUTION_VERSION=v2.8.3-harbor.1-rc.1
19+
ARG DISTRIBUTION_COMMIT=086d3c33b3981cf598d0d82336a907fcf5c4c848
20+
ARG REGISTRY_VERSION=v2.8.3-patch-redis
21+
ARG TRIVY_ADAPTER_VERSION=v0.36.0
22+
ARG TRIVY_ADAPTER_COMMIT=f76a65660d4f4897a6c9b445ec91cbd76d685b5e
23+
ARG TRIVY_VERSION=v0.70.0
24+
ARG SWAGGER_VERSION=v0.33.1
25+
26+
# Every Go stage uses this golang image; the source stage checks it against
27+
# upstream's GOBUILDIMAGE.
28+
FROM --platform=$BUILDPLATFORM golang:1.25.9@sha256:8a7adc288b77e9b787cd2695029eb54d10ae80571b21d44fed68d067ad0a9c96 AS source
29+
ARG VERSION
30+
ARG COMMIT
31+
ARG DISTRIBUTION_VERSION
32+
ARG REGISTRY_VERSION
33+
ARG TRIVY_ADAPTER_VERSION
34+
ARG TRIVY_VERSION
35+
ARG SWAGGER_VERSION
36+
RUN git clone --branch ${VERSION} --depth 1 https://github.com/goharbor/harbor /harbor \
37+
&& test "$(git -C /harbor rev-parse HEAD)" = "${COMMIT}"
38+
WORKDIR /harbor
39+
# A VERSION bump must not pair the new core with the old registry, scanner or
40+
# toolchain.
41+
RUN grep -qxF "REGISTRY_SRC_TAG=${DISTRIBUTION_VERSION}" Makefile \
42+
&& grep -qxF "REGISTRYVERSION=${REGISTRY_VERSION}" Makefile \
43+
&& grep -qxF "TRIVYADAPTERVERSION=${TRIVY_ADAPTER_VERSION}" Makefile \
44+
&& grep -qxF "TRIVYVERSION=${TRIVY_VERSION}" Makefile \
45+
&& grep -qxF "SWAGGER_VERSION=${SWAGGER_VERSION}" Makefile \
46+
&& grep -qxF "GOBUILDIMAGE=golang:$(go env GOVERSION | sed 's/^go//')" Makefile
47+
# Upstream's gen_apis: the API server package is generated, not committed.
48+
RUN go run github.com/go-swagger/go-swagger/cmd/swagger@${SWAGGER_VERSION} generate server \
49+
--template-dir=tools/swagger/templates --exclude-main \
50+
--additional-initialism=CVE --additional-initialism=GC --additional-initialism=OIDC \
51+
-f api/v2.0/swagger.yaml -A harbor --target src/server/v2.0
52+
# Upstream's versions_prepare; core serves it as the component versions.
53+
RUN printf 'VERSION_TAG: %s\nREGISTRY_VERSION: %s\nTRIVY_VERSION: %s\nTRIVY_ADAPTER_VERSION: %s\n' \
54+
"${VERSION}" "${REGISTRY_VERSION}" "${TRIVY_VERSION}" "${TRIVY_ADAPTER_VERSION}" > make/photon/prepare/versions
55+
56+
FROM --platform=$BUILDPLATFORM golang:1.25.9@sha256:8a7adc288b77e9b787cd2695029eb54d10ae80571b21d44fed68d067ad0a9c96 AS core-bin
57+
ARG VERSION
58+
ARG COMMIT
59+
ARG TARGETOS
60+
ARG TARGETARCH
61+
COPY --from=source /harbor/src /harbor/src
62+
WORKDIR /harbor/src/core
63+
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
64+
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -buildvcs=false \
65+
-ldflags "-w -s -X github.com/goharbor/harbor/src/pkg/version.GitCommit=$(echo ${COMMIT} | cut -c1-8) -X github.com/goharbor/harbor/src/pkg/version.ReleaseVersion=${VERSION}" \
66+
-o /out/harbor_core
67+
68+
FROM --platform=$BUILDPLATFORM golang:1.25.9@sha256:8a7adc288b77e9b787cd2695029eb54d10ae80571b21d44fed68d067ad0a9c96 AS jobservice-bin
69+
ARG TARGETOS
70+
ARG TARGETARCH
71+
COPY --from=source /harbor/src /harbor/src
72+
WORKDIR /harbor/src/jobservice
73+
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
74+
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -buildvcs=false -o /out/harbor_jobservice
75+
76+
FROM --platform=$BUILDPLATFORM golang:1.25.9@sha256:8a7adc288b77e9b787cd2695029eb54d10ae80571b21d44fed68d067ad0a9c96 AS registryctl-bin
77+
ARG TARGETOS
78+
ARG TARGETARCH
79+
COPY --from=source /harbor/src /harbor/src
80+
WORKDIR /harbor/src/registryctl
81+
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
82+
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -buildvcs=false -o /out/harbor_registryctl
83+
84+
FROM --platform=$BUILDPLATFORM golang:1.25.9@sha256:8a7adc288b77e9b787cd2695029eb54d10ae80571b21d44fed68d067ad0a9c96 AS exporter-bin
85+
ARG VERSION
86+
ARG COMMIT
87+
ARG TARGETOS
88+
ARG TARGETARCH
89+
COPY --from=source /harbor/src /harbor/src
90+
WORKDIR /harbor/src/cmd/exporter
91+
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
92+
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -buildvcs=false \
93+
-ldflags "-w -s -X github.com/goharbor/harbor/src/pkg/version.ReleaseVersion=${VERSION} -X github.com/goharbor/harbor/src/pkg/version.GitCommit=$(echo ${COMMIT} | cut -c1-8)" \
94+
-o /out/harbor_exporter
95+
96+
# Harbor's fork of distribution predates Go modules: it builds in GOPATH mode
97+
# against its vendor/ tree, as upstream's make/photon/registry/Dockerfile.binary.
98+
FROM --platform=$BUILDPLATFORM golang:1.25.9@sha256:8a7adc288b77e9b787cd2695029eb54d10ae80571b21d44fed68d067ad0a9c96 AS registry-bin
99+
ARG DISTRIBUTION_VERSION
100+
ARG DISTRIBUTION_COMMIT
101+
ARG TARGETOS
102+
ARG TARGETARCH
103+
ENV SRC=/go/src/github.com/docker/distribution
104+
RUN git clone --branch ${DISTRIBUTION_VERSION} --depth 1 https://github.com/goharbor/distribution ${SRC} \
105+
&& test "$(git -C ${SRC} rev-parse HEAD)" = "${DISTRIBUTION_COMMIT}"
106+
WORKDIR ${SRC}
107+
RUN --mount=type=cache,target=/root/.cache/go-build \
108+
CGO_ENABLED=0 GO111MODULE=off GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -tags "include_oss include_gcs" \
109+
-ldflags "-s -w -X github.com/docker/distribution/version.Version=${DISTRIBUTION_VERSION} -X github.com/docker/distribution/version.Revision=${DISTRIBUTION_COMMIT} -X github.com/docker/distribution/version.Package=github.com/docker/distribution" \
110+
-o /out/registry ./cmd/registry
111+
112+
FROM --platform=$BUILDPLATFORM golang:1.25.9@sha256:8a7adc288b77e9b787cd2695029eb54d10ae80571b21d44fed68d067ad0a9c96 AS trivy-bin
113+
ARG TRIVY_ADAPTER_VERSION
114+
ARG TRIVY_ADAPTER_COMMIT
115+
ARG TRIVY_VERSION
116+
ARG TARGETOS
117+
ARG TARGETARCH
118+
RUN git clone --branch ${TRIVY_ADAPTER_VERSION} --depth 1 https://github.com/goharbor/harbor-scanner-trivy /src \
119+
&& test "$(git -C /src rev-parse HEAD)" = "${TRIVY_ADAPTER_COMMIT}"
120+
WORKDIR /src
121+
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
122+
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /out/scanner-trivy ./cmd/scanner-trivy
123+
# Checksums from the release's trivy_<version>_checksums.txt.
124+
RUN case "${TARGETARCH}" in \
125+
amd64) arch=64bit sum=8b4376d5d6befe5c24d503f10ff136d9e0c49f9127a4279fd110b727929a5aa9 ;; \
126+
arm64) arch=ARM64 sum=2f6bb988b553a1bbac6bdd1ce890f5e412439564e17522b88a4541b4f364fc8d ;; \
127+
*) echo "unsupported TARGETARCH ${TARGETARCH}" >&2; exit 1 ;; \
128+
esac \
129+
&& curl -sSfL -o /tmp/trivy.tgz https://github.com/aquasecurity/trivy/releases/download/${TRIVY_VERSION}/trivy_${TRIVY_VERSION#v}_Linux-${arch}.tar.gz \
130+
&& echo "${sum} /tmp/trivy.tgz" | sha256sum -c - \
131+
&& tar -xzf /tmp/trivy.tgz -C /out trivy
132+
133+
FROM goharbor/photon:5.0@sha256:0e06d58615400bf2a3fe7da1175b889e2827969e3ac42e1c4010010770e6a712 AS harbor-base
134+
RUN tdnf install -y tzdata shadow >> /dev/null \
135+
&& tdnf clean all \
136+
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -m -g 10000 -u 10000 harbor \
137+
&& mkdir -p /harbor /etc/registry \
138+
&& chown -R harbor:harbor /harbor /etc/pki/tls/certs
139+
140+
FROM harbor-base AS harbor-core
141+
COPY --from=source --chown=harbor:harbor --chmod=755 /harbor/make/photon/common/install_cert.sh /harbor/make/photon/core/entrypoint.sh /harbor/
142+
COPY --from=core-bin --chown=harbor:harbor /out/harbor_core /harbor/
143+
COPY --from=source --chown=harbor:harbor /harbor/src/core/views /harbor/views
144+
COPY --from=source --chown=harbor:harbor /harbor/make/migrations /harbor/migrations
145+
COPY --from=source --chown=harbor:harbor /harbor/icons /harbor/icons
146+
COPY --from=source --chown=harbor:harbor /harbor/make/photon/prepare/versions /harbor/
147+
WORKDIR /harbor/
148+
USER harbor
149+
ENTRYPOINT ["/harbor/entrypoint.sh"]
150+
151+
FROM harbor-base AS harbor-jobservice
152+
COPY --from=source --chown=harbor:harbor --chmod=755 /harbor/make/photon/common/install_cert.sh /harbor/make/photon/jobservice/entrypoint.sh /harbor/
153+
COPY --from=jobservice-bin --chown=harbor:harbor /out/harbor_jobservice /harbor/
154+
WORKDIR /harbor/
155+
USER harbor
156+
VOLUME ["/var/log/jobs/"]
157+
ENTRYPOINT ["/harbor/entrypoint.sh"]
158+
159+
FROM harbor-base AS harbor-exporter
160+
COPY --from=source --chown=harbor:harbor --chmod=755 /harbor/make/photon/common/install_cert.sh /harbor/make/photon/exporter/entrypoint.sh /harbor/
161+
COPY --from=exporter-bin --chown=harbor:harbor /out/harbor_exporter /harbor/
162+
WORKDIR /harbor
163+
USER harbor
164+
ENTRYPOINT ["/harbor/entrypoint.sh"]
165+
166+
FROM harbor-base AS registry-photon
167+
COPY --from=source --chown=harbor:harbor --chmod=755 /harbor/make/photon/common/install_cert.sh /harbor/make/photon/registry/entrypoint.sh /home/harbor/
168+
COPY --from=registry-bin --chown=harbor:harbor /out/registry /usr/bin/registry_DO_NOT_USE_GC
169+
USER harbor
170+
VOLUME ["/storage"]
171+
ENTRYPOINT ["/home/harbor/entrypoint.sh"]
172+
173+
FROM harbor-base AS harbor-registryctl
174+
COPY --from=source --chown=harbor:harbor --chmod=755 /harbor/make/photon/common/install_cert.sh /harbor/make/photon/registryctl/start.sh /home/harbor/
175+
COPY --from=registryctl-bin --chown=harbor:harbor /out/harbor_registryctl /home/harbor/
176+
COPY --from=registry-bin --chown=harbor:harbor /out/registry /usr/bin/registry_DO_NOT_USE_GC
177+
USER harbor
178+
VOLUME ["/var/lib/registry"]
179+
ENTRYPOINT ["/home/harbor/start.sh"]
180+
181+
FROM goharbor/photon:5.0@sha256:0e06d58615400bf2a3fe7da1175b889e2827969e3ac42e1c4010010770e6a712 AS trivy-adapter-photon
182+
ARG TRIVY_VERSION
183+
RUN tdnf install -y rpm shadow >> /dev/null \
184+
&& tdnf clean all \
185+
&& groupadd -r -g 10000 scanner && useradd --no-log-init -m -r -g 10000 -u 10000 scanner \
186+
&& chown -R scanner:scanner /etc/pki/tls/certs
187+
COPY --from=source --chown=scanner:scanner --chmod=755 /harbor/make/photon/common/install_cert.sh /harbor/make/photon/trivy-adapter/entrypoint.sh /home/scanner/
188+
COPY --from=trivy-bin --chown=scanner:scanner /out/trivy /usr/local/bin/trivy
189+
COPY --from=trivy-bin --chown=scanner:scanner /out/scanner-trivy /home/scanner/bin/scanner-trivy
190+
ENV TRIVY_VERSION=${TRIVY_VERSION}
191+
USER scanner
192+
ENTRYPOINT ["/home/scanner/entrypoint.sh"]
193+
194+
FROM goharbor/photon:5.0@sha256:0e06d58615400bf2a3fe7da1175b889e2827969e3ac42e1c4010010770e6a712 AS nginx-photon
195+
RUN tdnf install -y nginx shadow >> /dev/null \
196+
&& tdnf clean all \
197+
&& groupmod -g 10000 nginx && usermod -g 10000 -u 10000 -d /home/nginx -s /bin/bash nginx \
198+
&& ln -sf /dev/stdout /var/log/nginx/access.log \
199+
&& ln -sf /dev/stderr /var/log/nginx/error.log
200+
VOLUME /var/cache/nginx /var/log/nginx /run
201+
STOPSIGNAL SIGQUIT
202+
USER nginx
203+
CMD ["nginx", "-g", "daemon off;"]

‎packages/system/harbor/values.yaml‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
1-
harbor: {}
1+
harbor:
2+
# The upstream v2.15 images are amd64-only; `make image` replaces each ref
3+
# with a multi-arch rebuild from images/.
4+
core:
5+
image:
6+
repository: docker.io/goharbor/harbor-core
7+
tag: v2.15.1@sha256:887a85b8ea98b76bfc9f715f1a0785bb99f9a1034241513902dd6e95be922a83
8+
jobservice:
9+
image:
10+
repository: docker.io/goharbor/harbor-jobservice
11+
tag: v2.15.1@sha256:0de4fd2ce3a02d3e6591b439e4674ea085885ddf43652b44004cc67eb19dba12
12+
portal:
13+
image:
14+
repository: docker.io/goharbor/harbor-portal
15+
tag: v2.15.1@sha256:ac55161c57a8351807adf8f8def264bdd52667c371d0436beefebdac4341c9e2
16+
registry:
17+
registry:
18+
image:
19+
repository: docker.io/goharbor/registry-photon
20+
tag: v2.15.1@sha256:ebf0325c2661729dbb317cbf839608eb8b15cfa158911a94976f2c21563c466e
21+
controller:
22+
image:
23+
repository: docker.io/goharbor/harbor-registryctl
24+
tag: v2.15.1@sha256:554147a956989175f63f8d41573d716c6ddf6052acd1749c88c0f99ce6ee2bff
25+
exporter:
26+
image:
27+
repository: docker.io/goharbor/harbor-exporter
28+
tag: v2.15.1@sha256:372275b6b6abeb571fa7bd5de458e3d75f1a1636503b3c0abe02938f2b285d75
29+
nginx:
30+
image:
31+
repository: docker.io/goharbor/nginx-photon
32+
tag: v2.15.1@sha256:1f9d06d040f2478f6cf7f6da0091877bf987a641810f4bfaadb2a87d73dbf4fb
33+
trivy:
34+
image:
35+
repository: docker.io/goharbor/trivy-adapter-photon
36+
tag: v2.15.1@sha256:f0c52bed36c083ec4fded26cefab01e4cd58c9354c261cb3156c69f57bb50131
237
db:
338
replicas: 2
439
size: 5Gi

0 commit comments

Comments
 (0)