Docker should use scratch instead of alpine
Opened this issue · 3 comments
I noticed that the current Dockerfile uses golang:alpine
when the image would be much smaller if it was from scratch
and just included a Go binary with bundled dependencies!
✌️
Hmm, I've never heard of scratch. I'll look into it, I've built the Dockerfile so that it should download the dependencies during building.
Thinking about it this would be much faster for development as well, I'll put the changes in tomorrow if I have time!
@kochie The idea of scratch is you have a Go binary with all dependencies bundled and stored in a Docker image, so the size of the image is just the size of the binary! Obviously this would be for a production deployment not development env..
The issue at the moment is that pulling dependencies each time takes a lot of time in Go. At least the way I'm doing it. I might be able to change how the vendor packages work.