Skip to content

Commit f7dbac6

Browse files
committed
dockerfile
1 parent 0caf099 commit f7dbac6

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
## 1.0.2
3333
1. 修复在linux中对端口是否可用检测失败
3434

35-
## 1.1.0-rc.1
35+
## 1.1.0
3636
1. 使用[protobuf插件](https://github.com/lightbrotherV/gin-protobuf)重写http接口
3737
2. 添加兼容不同版本服务端组件
3838
3. 添加服务端备注
3939
4. 将命令行模式拆分出来
40-
5. 插件兼容1.16+
40+
5. 插件兼容1.16+
41+
6. 添加dockerfile

dockerfile/dockfile-1.0.2 renamed to dockerfile/dockfile-1.1.0

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,34 @@ ENV SMCD_DIR /data/app
44
# 设置工作目录
55
WORKDIR $SMCD_DIR
66

7-
ENV SMCD_VERSION 1.0.2
7+
ENV SMCD_VERSION 1.1.0
88

99
#部署环境
10-
RUN apt-get update \
11-
&& apt-get install -y --no-install-recommends g++ gcc libc6-dev make pkg-config wget xz-utils tar git python \
12-
10+
#修改阿里源
11+
RUN sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list \
12+
&& sed -i "s/security.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list \
13+
#安装依赖
14+
&& apt-get update \
15+
&& apt-get install -y --no-install-recommends g++ gcc libc6-dev make pkg-config xz-utils tar git python curl ca-certificates \
16+
#更新证书
17+
&& update-ca-certificates \
1318
#下载并解压node
14-
&& wget https://nodejs.org/dist/v14.12.0/node-v14.12.0-linux-x64.tar.xz --no-check-certificate \
19+
&& curl -O https://nodejs.org/dist/v14.12.0/node-v14.12.0-linux-x64.tar.xz \
1520
&& xz -d node-v14.12.0-linux-x64.tar.xz \
1621
&& tar xf node-v14.12.0-linux-x64.tar \
1722
&& rm node-v14.12.0-linux-x64.tar \
1823
&& mv node-v14.12.0-linux-x64 /node \
1924

2025
#下载并解压golang
21-
&& wget https://dl.google.com/go/go1.14.10.linux-amd64.tar.gz --no-check-certificate \
26+
&& curl -O https://dl.google.com/go/go1.14.10.linux-amd64.tar.gz \
2227
&& tar xzf go1.14.10.linux-amd64.tar.gz \
2328
&& rm go1.14.10.linux-amd64.tar.gz \
2429
&& mv go /go \
2530
&& rm -rf /var/lib/apt/lists/*
2631

2732
ENV GOROOT /go
2833
ENV GOPATH $SMCD_DIR/golang
29-
ENV GOPROXY https://goproxy.cn
34+
ENV GOPROXY https://mirrors.aliyun.com/goproxy/
3035
ENV PATH /node/bin:$GOROOT/bin:$PATH
3136

3237
#创建golang目录
@@ -35,13 +40,18 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin
3540
WORKDIR $GOPATH/src
3641

3742
#下载并编译smcd
38-
RUN git config --global http.sslverify false \
39-
&& git clone https://github.com/TISUnion/most-simple-mcd.git \
43+
RUN git clone https://github.com/TISUnion/most-simple-mcd.git \
4044
&& cd most-simple-mcd \
4145
&& git checkout 1.1.0-rc.1 \
4246
&& git submodule init \
4347
&& git submodule update \
4448
&& /bin/bash build.sh
4549

50+
EXPOSE 80 25565
51+
52+
WORKDIR $GOPATH/src/most-simple-mcd
53+
54+
#运行smcd
55+
ENTRYPOINT ["sh", "-c", "./main"]
4656

4757

0 commit comments

Comments
 (0)