-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathDockerfile
executable file
·32 lines (26 loc) · 978 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM centos:7.6.1810
# 安装中文字体和chrome
# gcc 支持golang cgo sqlite
RUN yum install -y wget gcc && \
yum install -y wqy-microhei-fonts wqy-zenhei-fonts && \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm && \
yum install -y ./google-chrome-stable_current_*.rpm && \
google-chrome --version && \
rm -rf *.rpm
# 设置go mod proxy 国内代理
# 设置golang path
ENV GOPROXY=https://goproxy.io GOPATH=/gopath PATH="${PATH}:/usr/local/go/bin"
# 定义使用的Golang 版本
ARG GO_VERSION=1.13.3
# 安装 golang 1.13.3
RUN wget "https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz" && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf "go$GO_VERSION.linux-amd64.tar.gz" && \
rm -rf *.tar.gz && \
go version && go env;
WORKDIR "${GOPATH}/sshfortress"
COPY . .
RUN go build -o _build/sshfortress
#映射配置文件
VOLUME /etc/sshfortress/config.toml
CMD ["_build/sshfortress","sqlite"]