- Distributed Computing with Go
- V.N. Nikhil Anurag
- 154字
- 2021-06-24 18:36:08
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.
推薦閱讀
- Linux系統(tǒng)文件安全實(shí)戰(zhàn)全攻略
- Linux運(yùn)維實(shí)戰(zhàn):CentOS7.6操作系統(tǒng)從入門到精通
- Kubernetes網(wǎng)絡(luò)權(quán)威指南:基礎(chǔ)、原理與實(shí)踐
- 精通Linux內(nèi)核開發(fā)
- STM32庫開發(fā)實(shí)戰(zhàn)指南:基于STM32F4
- Application Development in iOS 7
- Delphi Programming Projects
- AWS SysOps Cookbook
- 分布式高可用架構(gòu)之道
- Troubleshooting Docker
- Linux網(wǎng)絡(luò)配置與安全管理
- VMware Horizon Mirage Essentials
- Linux系統(tǒng)安全:縱深防御、安全掃描與入侵檢測
- Learn OpenShift
- 電腦辦公(Windows10+Office2016)從新手到高手