Since Golang allows us to package our api into a single executable, we can begin to run this in a very small image layer that only has the executable. Thus we should have two image layers in the Dockerfile; a build layer and a final layer. The final layer will need the built executable and the goose binary to run migrations. The build layer we be the only layer built when running docker-compose. The final layer will be the layer that is packaged and tagged.
Description
Since Golang allows us to package our api into a single executable, we can begin to run this in a very small image layer that only has the executable. Thus we should have two image layers in the Dockerfile; a
build
layer and afinal
layer. The final layer will need the built executable and the goose binary to run migrations. The build layer we be the only layer built when running docker-compose. The final layer will be the layer that is packaged and tagged.