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

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.
主站蜘蛛池模板: 桦川县| 剑川县| 句容市| 集贤县| 昌都县| 达拉特旗| 德格县| 昌吉市| 浮山县| 台安县| 昌乐县| 临潭县| 繁峙县| 苏州市| 启东市| 兴隆县| 灵石县| 土默特左旗| 那坡县| 增城市| 平果县| 建平县| 贡觉县| 崇左市| 元阳县| 乐东| 海兴县| 讷河市| 通海县| 商城县| 托里县| 仙桃市| 瑞金市| 大安市| 隆尧县| 仪陇县| 桃江县| 湾仔区| 阿拉善右旗| 延庆县| 潢川县|