Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
system_pay
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王沛
system_pay
Commits
c1ddc150
Commit
c1ddc150
authored
Jun 20, 2023
by
zhengxiuming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confi
parent
a7c03035
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
Dockerfile
Dockerfile
+3
-13
No files found.
Dockerfile
View file @
c1ddc150
# 声明镜像来源为golang:alpine
FROM
golang:
latest
FROM
golang:
alpine
# 设置环境变量GO111MODULE为on
ENV
GO111MODULE=on
...
...
@@ -14,8 +14,7 @@ WORKDIR /go/src/system_pay
COPY
. .
# go env为查看go的环境变量, go build -o server . 为打包项目,二进制
# RUN go env && go mod tidy && go build -o server .
RUN
go
env
&&
go mod tidy
&&
go get
-u
golang.org/x/sys
&&
go build
-o
server .
RUN
go
env
&&
go mod tidy
&&
go build
-o
server .
# ======= 以下为多阶段构建 =======
...
...
@@ -31,20 +30,11 @@ RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main/" > /etc/apk/repositories \
# 声明工作目录
WORKDIR
/go/src/system_pay
# 拷贝配置文件到当前工作目录
COPY
--from=0 /go/src/system_pay/conf ./conf
# 拷贝打包好的server二进制文件到当前工作目录
COPY
--from=0 /go/src/system_pay/server ./
# 拷贝配置文件到当前工作目录
# COPY --from=0 /go/src/system_pay/conf ./conf
# 拷贝国际化文件夹到当前工作目录
# COPY --from=0 /go/src/system_pay/i18n ./i18n
# 拷贝国际化文件夹到当前工作目录
# COPY --from=0 /go/src/system_pay/docs ./docs
COPY
--from=0 /go/src/system_pay/conf ./conf
# 运行打包好的二进制
ENTRYPOINT
./server
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment