Files
k0s/Dockerfile
Tom Wieczorek 6eb911772f Pin container images used by inttests by digest
Official Docker image tags may be re-pushed from time to time. In the
past, such updated images have broken the integration tests several
times without any change to the code base.

As much as possible, reference all container images using both their tag
and digest, and use the most specific tags available. Consolidate the
images being used to reduce version churn. As a side effect, this should
allow using the most recent sonobuoy, which defaults to a non-existent
image tag.

Renovate's docker versioning handles a leading "v" on its own.
Extracting the "v" beforehand caused digest lookups to target
non-existent tags. Use the matching regex to capture the "v" as part of
the version and use a "renovate: versioning=" comment to override the
versioning per image. This allows special versioning rules to be applied
to each image. For example, nginx's Alpine suffix isn't treated as a
compatibility marker.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
2026-09-21 11:20:16 +02:00

20 lines
544 B
Docker

ARG ALPINE_IMAGE
FROM $ALPINE_IMAGE
ARG TARGETARCH
RUN apk add --no-cache iptables tini \
&& for u in etcd kube-apiserver kube-scheduler konnectivity-server; do \
adduser --system --shell /sbin/nologin --no-create-home --home /var/lib/k0s --disabled-password --gecos '' "$u"; \
done
ENV KUBECONFIG=/var/lib/k0s/pki/admin.conf
ADD docker-entrypoint.sh /entrypoint.sh
ADD ./k0s-${TARGETARCH}/k0s /usr/local/bin/k0s
ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh" ]
# Start CMD
CMD ["k0s", "controller", "--enable-worker"]
# End CMD