Open landism opened 3 years ago
Lots of prior discussion on this here: https://github.com/kubernetes/kubernetes/issues/58512. It comes up a lot when you're using Bazel or Ko distroless images. I usually show people how to use a different base image that's better for live development
i would probably call this issue a feature request rather than a bug, given that Kubernetes treats it as kind/feature.
Lots of prior discussion on this here: kubernetes/kubernetes#58512. It comes up a lot when you're using Bazel or Ko distroless images. I usually show people how to use a different base image that's better for live development
i would probably call this issue a feature request rather than a bug, given that Kubernetes treats it as kind/feature.
@nicks What would you recommend as a better base image to use for live development?
The main requirements are sh
and tar
. You could use the busybox
image, for example: https://hub.docker.com/_/busybox which is probably the smallest image with minimal replacements of most Unix tools.
To use with Tilt, your Dockerfile
would be something like:
ARG base_image=scratch
FROM $base_image
...
Then in your Tiltfile
:
docker_build_with_restart(
'my-image',
'.',
dockerfile='Dockerfile',
build_args={'base_image': 'busybox'},
live_update=[
...
]
)
The GoogleContainerTools/distroless images are also popular minimal images, which, as @nicks mentioned, lack a shell/tools by default, but publish debug tags, e.g. gcr.io/distroless/base:debug
that include busybox and would be suitable.
Steps to Reproduce
FROM scratch
Expected Behavior
live_update works, or Tilt gives an error message saying it's not supported
Current Behavior
Notes
The two obvious options are:
tar
into the container.tar
way of syncing files into a container.kubectl cp
sounds promising, but...: