O'Reilly logo

Distributed Computing with Go by V.N. Nikhil Anurag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dockerfile

Now that we have the basics of Docker under our belt, let's look at the Dockerfile file we will be using as a template in this book.

Next, let's look at an example:

FROM golang:1.10# The base image we want to use to build our docker image from. # Since this image is specialized for golang it will have GOPATH = /go                ADD . /go/src/hello# We copy files & folders from our system onto the docker image                       RUN go install hello # Next we can create an executable binary for our project with the command,'go install' ENV NAME Bob# Environment variable NAME will be picked up by the program 'hello' and printed to console.ENTRYPOINT /go/bin/hello# Command to execute when we start the container # EXPOSE 9000 # Generally used for network applications. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required