k3s/package/Dockerfile

26 lines
840 B
Docker
Raw Normal View History

FROM alpine:3.12 as base
RUN apk add -U ca-certificates tar zstd
COPY build/out/data.tar.zst /
2019-01-09 16:54:15 +00:00
RUN mkdir -p /image/etc/ssl/certs /image/run /image/var/run /image/tmp /image/lib/modules /image/lib/firmware && \
tar -xa -C /image -f /data.tar.zst && \
2019-01-09 16:54:15 +00:00
cp /etc/ssl/certs/ca-certificates.crt /image/etc/ssl/certs/ca-certificates.crt
RUN cd image/bin && \
rm -f k3s && \
ln -s k3s-server k3s
2019-01-01 08:23:01 +00:00
2019-01-09 16:54:15 +00:00
FROM scratch
ARG VERSION="dev"
2019-01-09 16:54:15 +00:00
COPY --from=base /image /
RUN mkdir -p /etc && \
echo 'hosts: files dns' > /etc/nsswitch.conf && \
echo "PRETTY_NAME=\"K3s ${VERSION}\"" > /etc/os-release && \
chmod 1777 /tmp
2019-11-07 19:59:25 +00:00
VOLUME /var/lib/kubelet
VOLUME /var/lib/rancher/k3s
2019-01-09 16:54:15 +00:00
VOLUME /var/lib/cni
VOLUME /var/log
2019-05-03 22:03:10 +00:00
ENV PATH="$PATH:/bin/aux"
ENV CRI_CONFIG_FILE="/var/lib/rancher/k3s/agent/etc/crictl.yaml"
2019-01-09 16:54:15 +00:00
ENTRYPOINT ["/bin/k3s"]
CMD ["agent"]