sergripenko / port_service

0 stars 0 forks source link

Dockerfile questions #3

Open albertogviana opened 1 year ago

albertogviana commented 1 year ago

Testing your solution by building up the docker image with the make build and final make 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:

sergripenko commented 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

sergripenko commented 1 year ago

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