mirror of https://github.com/k3d-io/k3d
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.5 KiB
33 lines
1.5 KiB
4 years ago
|
FROM ubuntu:18.04 as base
|
||
|
RUN apt-get update -y && apt-get install -y ca-certificates
|
||
|
ADD k3s/build/out/data.tar.gz /image
|
||
|
RUN mkdir -p /image/etc/ssl/certs /image/run /image/var/run /image/tmp /image/lib/modules /image/lib/firmware && \
|
||
|
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
|
||
|
|
||
|
FROM ubuntu:18.04
|
||
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||
|
RUN apt-get update -y && apt-get -y install gnupg2 curl
|
||
|
RUN curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | apt-key add -
|
||
|
RUN curl -s -L https://nvidia.github.io/nvidia-container-runtime/ubuntu18.04/nvidia-container-runtime.list | tee /etc/apt/sources.list.d/nvidia-container-runtime.list
|
||
|
RUN apt-get update -y
|
||
|
RUN apt-get -y install nvidia-container-runtime
|
||
|
COPY --from=base /image /
|
||
|
RUN mkdir -p /etc && \
|
||
|
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||
|
RUN chmod 1777 /tmp
|
||
|
# Provide custom containerd configuration to configure the nvidia-container-runtime
|
||
|
RUN mkdir -p /var/lib/rancher/k3s/agent/etc/containerd/
|
||
|
COPY config.toml.tmpl /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl
|
||
|
# Deploy the nvidia driver plugin on startup
|
||
|
RUN mkdir -p /var/lib/rancher/k3s/server/manifests
|
||
|
COPY gpu.yaml /var/lib/rancher/k3s/server/manifests/gpu.yaml
|
||
|
VOLUME /var/lib/kubelet
|
||
|
VOLUME /var/lib/rancher/k3s
|
||
|
VOLUME /var/lib/cni
|
||
|
VOLUME /var/log
|
||
|
ENV PATH="$PATH:/bin/aux"
|
||
|
ENTRYPOINT ["/bin/k3s"]
|
||
|
CMD ["agent"]
|