Skip to content

Can I install /bin/bash on the Docker image? #903

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

You must be logged in to vote

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 - the bash binary kept complaining. However, I'm happy enough with this approach

Thanks for pointing out systemctl - I imagine I'd have found that as an issue had I continued with Busybox.

# @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 …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mrsimonemms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #901 on December 20, 2021 09:19.