tilt-extensions icon indicating copy to clipboard operation
tilt-extensions copied to clipboard

docker_build_with_restart doesn't work with scratch

Open w3irdrobot opened this issue 3 years ago • 2 comments

I recently ran into the issue where the docker_build_with_restart in the restart_process extension doesn't work if the root user doesn't exist in the image that is being used. I saw that in issue #52, the user was hardcoded to be the root user, which makes sense. However, Golang binaries are frequently deployed in scratch containers that don't have a root user. The solution so far has been to just make a second Dockerfile that has FROM alpine instead of FROM scratch. It'd be great not to have to do this though.

w3irdrobot avatar Mar 05 '21 20:03 w3irdrobot

Thanks for reporting!

I've taken the liberty of renaming the bug. You're correct that the lack of root is an issue, but the extension also relies on the existence of sh, touch, and date. This shouldn't be too bad to fix. I'll take a look later this week.

landism avatar Mar 09 '21 22:03 landism

It turns out getting rid of the extension's dependencies won't help much for the moment. I removed them all in a branch only to learn live_update doesn't work on scratch anyway. I've filed https://github.com/tilt-dev/tilt/issues/4303 for that.

landism avatar Mar 11 '21 16:03 landism