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

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.
主站蜘蛛池模板: 台南县| 彭山县| 岑巩县| 拜城县| 比如县| 通城县| 泉州市| 神池县| 天气| 重庆市| 商丘市| 盐池县| 和硕县| 阜新市| 长阳| 禹州市| 孟村| 庆云县| 泗水县| 阳原县| 建宁县| 荣昌县| 金沙县| 太原市| 四川省| 浪卡子县| 景泰县| 方山县| 青州市| 武穴市| 铜梁县| 资溪县| 无锡市| 南城县| 呼伦贝尔市| 东光县| 尖扎县| 河北省| 区。| 罗平县| 普宁市|