How it works...

Verify whether the Docker image has been created successfully by executing the following command:

$ docker images

This will list all the top-level images, their repositories, tags, and their size, as shown in the following screenshot:

Let's understand the Dockerfile we have created:

  • FROM golang:1.9.2: The FROM instruction specifies the base image, which is, for us golang:1.9.2
  • ENV SRC_DIR=/go/src/github.com/arpitaggarwal/: Here, we are setting the Go source code directory as an environment variable using the ENV statement
  • ENV GOBIN=/go/bin: Here, we are setting the GOBIN or a directory to generate executable binaries as an ...

Get Go Web Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.