zero-to-jupyterhub-k8s
zero-to-jupyterhub-k8s copied to clipboard
/bin/sh default when using extraContainers:
Bug description
When adding an extra containers for the single user environment the image-puller has a hardcoded command that it trys to execute to feedback if the process has been completed.
command:
- /bin/sh
- -c
- echo "Pulling complete"
A issue arrises where when a extra container may not have bash and this causes an error preventing the startup of a container.
How to reproduce
Add any container that does not have /bin/bash to the singleUser environment, in my experience I was trying to add cloud-sql-proxy.
Expected behaviour
The image should run as expected and not be prevented by a JupyterHub requirement that all extra containers should have bash installed.
Actual behaviour
Error within the image-puller daemon set.
Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unab │ │ le to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown
Running a minimal command means we can pre-pull an image by running it as a daemonset.
Do you have a suggestion for a better way to pre-pull images? Would you be happy if the command was configurable for each pulled image?
Well the issue with this command or even I guess the requirement for a command is some images are distroless which this clearly wont work with.
A configurable command may allow more options for sure, although Im not sure in my case it would be a solution either.
I had a similar issue: the distroless image has busybox but has nothing in /bin/sh
Worked this around by creating a custom image with the following Dockerfile:
FROM myrepo/image-distroless:latest
RUN /busybox/busybox ln -sf /busybox/busybox /bin/sh
I don't like this solution as it requires an additional custom image (and probably private registry infrastructure) but it works.