Can I install /bin/bash on the Docker image? #903
-
Question / Where do you need Help?I work at Gitpod and trying to use K3d as a simple way of getting self-hosted running fast and simply. One part of the installation process is an As far as I can make out, the Docker image does not have I've tried mounting Scope of your Question
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @mrsimonemms , thanks for opening this discussion! |
Beta Was this translation helpful? Give feedback.
-
Thanks @iwilltry42. I've "solved" the issue by creating a custom Dockerfile. It's a little rough-and-ready, but it seems to work fairly well for my needs. Strangely, trying it the other way round (eg, create an Alpine image, install Thanks for pointing out # @link https://github.com/k3s-io/k3s/blob/master/package/Dockerfile
ARG K3S_VERSION=v1.21.7-k3s1
FROM rancher/k3s:${K3S_VERSION} AS k3s
FROM alpine
COPY --from=k3s / /
RUN apk add --no-cache bash
## This is as per-the parent image
RUN 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"] |
Beta Was this translation helpful? Give feedback.
Thanks @iwilltry42.
I've "solved" the issue by creating a custom Dockerfile. It's a little rough-and-ready, but it seems to work fairly well for my needs. Strangely, trying it the other way round (eg, create an Alpine image, install
bash
and import into the k3s image) didn't work - thebash
binary kept complaining. However, I'm happy enough with this approachThanks for pointing out
systemctl
- I imagine I'd have found that as an issue had I continued with Busybox.