-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.k3s
30 lines (29 loc) · 1.13 KB
/
Dockerfile.k3s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM alpine:latest
ARG K3S_VERSION
RUN set -ex && \
apk add --no-cache bash curl nfs-utils && \
[[ "$(uname -m)" == "aarch64" ]] && SUFFIX="-arm64" || SUFFIX="" && \
curl -L -f https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION/\-/%2B}/k3s${SUFFIX} -o /bin/k3s && \
chmod +x /bin/k3s && \
ln -s /bin/k3s ./bin/k3s-agent && \
ln -s /bin/k3s ./bin/k3s-server && \
ln -s /bin/k3s ./bin/k3s-etcd-snapshot && \
ln -s /bin/k3s ./bin/k3s-secrets-encrypt && \
ln -s /bin/k3s ./bin/k3s-certificate && \
ln -s /bin/k3s ./bin/k3s-completion && \
ln -s /bin/k3s ./bin/kubectl && \
ln -s /bin/k3s ./bin/crictl && \
ln -s /bin/k3s ./bin/ctr && \
# Copied from https://github.com/k3s-io/k3s/blob/master/package/Dockerfile
mkdir -p /etc && \
echo 'hosts: files dns' > /etc/nsswitch.conf && \
echo "PRETTY_NAME=\"K3s ${K3S_VERSION}\"" > /etc/os-release && \
chmod 1777 /tmp
VOLUME /var/lib/kubelet
VOLUME /var/lib/rancher/k3s
VOLUME /var/lib/cni
VOLUME /var/log
ENV PATH="$PATH:/bin/aux"
ENV CRI_CONFIG_FILE="/var/lib/rancher/k3s/agent/etc/crictl.yaml"
ENTRYPOINT ["/bin/k3s"]
CMD ["agent"]