|
1 | | -FROM scratch |
| 1 | +# renovate: datasource=docker depName=stagex/core-busybox versioning=loose |
| 2 | +ARG BUSYBOX_IMAGE=stagex/core-busybox:sx2026.03.0@sha256:4f3e3849acb54972e7c4f1d08c320526e0f8b314130bda68f83f821b02b4890b |
2 | 3 |
|
3 | | -COPY --from=stagex/core-busybox /bin/mkdir /bin/mkdir |
4 | | -COPY --from=stagex/core-busybox /usr/bin/mkdir /usr/bin/mkdir |
| 4 | +# Import the pinned image so we can COPY from it (workaround for --from + ARG). |
| 5 | +FROM ${BUSYBOX_IMAGE} AS busybox |
5 | 6 |
|
6 | | -COPY --from=stagex/core-busybox /bin/cp /bin/cp |
7 | | -COPY --from=stagex/core-busybox /usr/bin/cp /usr/bin/cp |
| 7 | +# Layout stage: temporarily bring in mkdir to create the directory tree. |
| 8 | +# This stage's tools are discarded; only the resulting /plugins tree is used. |
| 9 | +FROM scratch AS layout |
8 | 10 |
|
| 11 | +COPY --from=busybox /bin/mkdir /bin/mkdir |
| 12 | +COPY --from=busybox /usr/bin/mkdir /usr/bin/mkdir |
9 | 13 |
|
10 | 14 | RUN ["/bin/mkdir", "-p", "/plugins/capsule"] |
11 | | - |
12 | 15 | COPY dist/main.js /plugins/capsule/main.js |
13 | 16 | COPY package.json /plugins/capsule/package.json |
| 17 | + |
| 18 | +# Final image: minimal for use as an initContainer volume image. |
| 19 | +FROM scratch |
| 20 | + |
| 21 | +# cp is needed at runtime to support the documented pattern: |
| 22 | +# command: ['cp', '-r', '/plugins/capsule', '/plugins'] |
| 23 | +# mkdir is build-time only and not included here. |
| 24 | +COPY --from=busybox /bin/cp /bin/cp |
| 25 | +COPY --from=busybox /usr/bin/cp /usr/bin/cp |
| 26 | + |
| 27 | +COPY --from=layout /plugins /plugins |
| 28 | + |
| 29 | +# OCI image labels (annotations / tags) |
| 30 | +LABEL org.opencontainers.image.source="https://github.com/projectcapsule/headlamp-plugin" |
| 31 | +LABEL org.opencontainers.image.description="Capsule multi-tenancy plugin for Headlamp" |
| 32 | +LABEL org.opencontainers.image.licenses="Apache-2.0" |
0 commit comments