Files
cozystack/packages/system/objectstorage-controller/images/objectstorage/Dockerfile
T
Aleksei Sviridkin 6edd4a0d72 chore(deps): update container base images
Refresh the base image digests and move each tag to a newer release
that builds: node 24 for the dashboard console and its UI test job,
nginx-unprivileged 1.31, the dockerfile 1.28 frontend and alpine 3.24
for the cilium patch stage.

The kubevirt CSI driver stays on AlmaLinux 9: AlmaLinux 10 builds its
amd64 userland for x86-64-v3, and on a tenant vCPU without it every
mkfs, blkid and mount the node service runs would fail. shadowbox stays
on node 18 because outline-server declares engines node 18.x. The e2e
sandbox stays on Ubuntu 24.04: 26.04 ships uutils coreutils, whose
`date` costs about 4x per call, and the test harness forks it per
traced line, which adds about ten minutes to the install phase. Bases
whose version is the upstream component itself, or that upstream's
build pins, are not touched.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 01:07:39 +03:00

50 lines
2.1 KiB
Docker

# syntax=docker/dockerfile:1.28@sha256:bb22d9815c728170f72750f4e5b0d672e06176142e1d602c7e66c050100b7e5b
FROM alpine@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6 AS source
ARG COMMIT_REF=v0.2.2
RUN apk add --no-cache curl tar git
WORKDIR /src
RUN curl -sSL https://github.com/kubernetes-sigs/container-object-storage-interface/archive/${COMMIT_REF}.tar.gz \
| tar -xz --strip-components=1
COPY patches /patches
RUN git apply /patches/*.diff
FROM --platform=$BUILDPLATFORM docker.io/golang:1.27@sha256:e432b43af23a9328d56a7c499be0476810aa344acbcf65fc7c455d4ff5a40602 AS builder
ARG GOPROXY
ARG TARGETOS
ARG TARGETARCH
WORKDIR /go/src/cosi
COPY --from=source /src/go.mod /src/go.sum /src ./
RUN for attempt in 1 2 3; do go mod download && break; [ "$attempt" = 3 ] && exit 1; sleep $((attempt * 10)); done
COPY --from=source /patches /patches
# go build never compiles a _test.go, so nothing else runs the tests of the
# packages the patches touch. Each package is tested from its own directory:
# that finds the module it belongs to (internal/ is one of its own), and an
# empty list runs nothing.
# The list is read into a variable first: a for loop drops the exit status
# of a command substitution, so a patch git cannot read would leave the list
# empty and the step green.
RUN files=$(git apply --numstat /patches/*.diff) || exit 1; \
for dir in $(printf '%s\n' "$files" | cut -f3 | grep '\.go$' | xargs -r -n1 dirname | sort -u); do \
(cd "$dir" && go test .) || exit 1; \
done
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /build/controller ./controller/cmd \
&& CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /build/sidecar ./sidecar/cmd
FROM gcr.io/distroless/static:nonroot@sha256:e2e927ec666bae08560abb3c55d0659eceabb657f56b6782ab500a9fc7f555e3 AS controller
COPY --from=builder /build/controller /controller
USER 65532:65532
ENTRYPOINT ["/controller"]
FROM gcr.io/distroless/static:nonroot@sha256:e2e927ec666bae08560abb3c55d0659eceabb657f56b6782ab500a9fc7f555e3 AS sidecar
COPY --from=builder /build/sidecar /sidecar
USER 65532:65532
ENTRYPOINT ["/sidecar"]