By using Mulitstage Dockerfile you can define several docker images and copy/paste files from one of them to another. By this way it's possible to have a first image that build the binary of Hercules (From golang) and a second to execute the binary (From scratch or alpine) to reduce the size of the final docker image.
Image before the PR:
Image after the PR:
How it works ?
By using Mulitstage Dockerfile you can define several docker images and copy/paste files from one of them to another. By this way it's possible to have a first image that build the binary of Hercules (From golang) and a second to execute the binary (From scratch or alpine) to reduce the size of the final docker image.
Reference
https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds