cd echo
go run main.go
docker build --tag echo-hello .
docker image ls
docker image tag echo-hello:latest echo-hello:v1.0
docker image rm echo-hello:v1.0
docker build -t echo-hello:multistage -f Dockerfile.multistage .
Multistate build reduces image size signicantly. For more details, refer distroless.
docker run -p 8080:8080 <IMAGE_ID>
You can access the app with curl command.
curl http://localhost:8080