mirror of
https://github.com/k0sproject/k0s.git
synced 2026-10-28 11:04:40 +08:00
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>
20 lines
544 B
Docker
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
|