Docker image to use for compiled go program

Hi

I’m experimenting with docker and go and now I’m building the application outside the docker image and copies the built application. I have tried busybox and alpine which are really small images and everything seems to work nicely. The go application is a statically build executable so I guess it really don’t need much from the runtime.

However I wonder if anyone here has used any other image and why?

With regards, Johan

You can pretty much use FROM scratch, but there are a couple of details. A resolv.conf for name resolution is one, a suite of CA certificates for HTTPS is another. People have done experiments though:

(They seem to skip the points I mentioned above, so I guess that’s often not essential.)

2 Likes

Thanks a lot!

This seems really good. They handle certificates in the two phase build at the end of the page. I tested if resolving works by building a container based on scratch, The resolv file was empty, but the program did a net.LookupHost() and it worked :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.