Open albertogviana opened 1 year ago
yes, in future we can use 2 images: one golang image for build binary and second alpine image for other packages, configuration files and etc
for reduce image size we can squash multiple layers into one with multi-stage Docker builds and also we can use node-distroless directive when we build image
Testing your solution by building up the docker image with the
make build
and finalmake run
commands was quite easy and quick.https://github.com/sergripenko/port_service/blob/234379724ddf34d1655583524e984a119683c0ca/Dockerfile#L14
You are using a base golang image to build the binaries, and then you are running the final binary into the same image: