9.9.3 Docker Instructions
Docker instructions for building and publishing the Go application as container image.
9.9.3.1 Docker instructions
Building, testing and publishing of the container image using Docker .
Image build
Docker build command:
docker build -t go-hello-world
Image test
Docker run command:
docker run -p 8080:8080 -ti go-hello-world
It can be tested with a browser (http://localhost:8080/world ) or using curl:
curl localhost:8080/world
Publish image to Docker Hub
docker login
docker tag go-hello-world:latest appuio/go-hello-world:latest
docker push appuio/go-hello-world:latest