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

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.
主站蜘蛛池模板: 三都| 曲靖市| 华宁县| 炉霍县| 和田市| 门头沟区| 石柱| 禄劝| 临桂县| 浦东新区| 泗洪县| 佳木斯市| 普洱| 株洲县| 广宁县| 安阳县| 西贡区| 云和县| 渑池县| 东光县| 嘉鱼县| 奎屯市| 广河县| 陇南市| 泸溪县| 绍兴市| 彩票| 梧州市| 永泰县| 乌拉特中旗| 青神县| 大田县| 建瓯市| 涞水县| 南涧| 丹江口市| 阜平县| 莲花县| 汾西县| 丽水市| 大名县|