Skip to content

How can I create an Ubuntu-based image? #989

Answered by mrsimonemms
mrsimonemms asked this question in Q&A
Discussion options

You must be logged in to vote

It seems that there's a conflict with /usr/bin - just copying the /bin seems to work. This is now my Dockerfile

ARG K3S_VERSION=v1.22.6-k3s1
FROM rancher/k3s:${K3S_VERSION} AS k3s

FROM ubuntu:20.04
COPY --from=k3s /bin /bin
RUN mkdir -p /etc \
  && echo 'hosts: files dns' > /etc/nsswitch.conf \
  && chmod 1777 /tmp \
  && mkdir -p /var/lib/rancher/k3s/agent/etc/containerd/
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"]

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@iwilltry42
Comment options

Answer selected by mrsimonemms
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants