官术网_书友最值得收藏!

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. Allows us to connect to the
application running inside the container from host system's localhost.
主站蜘蛛池模板: 通山县| 名山县| 即墨市| 特克斯县| 若尔盖县| 砀山县| 汉阴县| 湟中县| 锡林郭勒盟| 甘洛县| 鄂伦春自治旗| 仲巴县| 长武县| 乐平市| 分宜县| 磐安县| 那曲县| 钟祥市| 竹北市| 龙门县| 马边| 罗田县| 武陟县| 综艺| 仁化县| 商都县| 仪陇县| 岳普湖县| 乳山市| 拉孜县| 延长县| 广南县| 平泉县| 民丰县| 海门市| 敖汉旗| 女性| 柯坪县| 青龙| 大庆市| 百色市|