I'm not sure I entirely follow.
The Dockerfile from the linked project builds an image with nothing in it except an executable - there will be no shell or compiler, so running bash will be impossible. It does this by using the special scratch
base image, which is simply a completely empty filesystem.
If you clone the repository and build the image using the Dockerfile (docker build -t go-image .
), it will simply copy the executable directly into the image (note the Dockerfile copies the executable true-asm
, not the source code true.go
). If you then use docker run
to start the image, it will run it (docker run go-image
).
Does that make sense? The code is compiled locally (or by another container) and the compiled, stand-alone executable is placed by itself into the image.
Generally, you don't want to do this and definitely not when you're beginning - it will be easier for you to use a golang
or debian
image which will include basic tools such as a shell.