- 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.
推薦閱讀
- PLC控制程序精編108例
- Implementing Cisco UCS Solutions
- Windows Server 2012 Hyper-V:Deploying the Hyper-V Enterprise Server Virtualization Platform
- Mobile-first Bootstrap
- 白話區(qū)塊鏈
- Linux網(wǎng)絡(luò)操作系統(tǒng)與實(shí)訓(xùn)(第三版)
- Ganglia系統(tǒng)監(jiān)控
- SharePoint 2013 應(yīng)用開發(fā)實(shí)戰(zhàn)
- Implementing Azure DevOps Solutions
- 計(jì)算機(jī)系統(tǒng)開發(fā)與優(yōu)化實(shí)戰(zhàn)
- 數(shù)據(jù)中心系統(tǒng)工程及應(yīng)用
- 嵌入式實(shí)時(shí)操作系統(tǒng):RT-Thread設(shè)計(jì)與實(shí)現(xiàn)
- 網(wǎng)絡(luò)操作系統(tǒng)教程:Windows Server 2016管理與配置
- 精解Windows 10
- 從實(shí)踐中學(xué)習(xí)Windows滲透測試