Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nbya
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
haoyanbin
nbya
Commits
840de153
Commit
840de153
authored
3 years ago
by
haoyanbin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.pet-dbc.cn/haoyanbin/nbya
parents
b947a816
efa8a372
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
Dockerfile
Dockerfile
+8
-2
PROD.Dockerfile
PROD.Dockerfile
+12
-4
No files found.
Dockerfile
View file @
840de153
...
...
@@ -5,7 +5,7 @@ ENV GOPROXY=https://goproxy.cn,direct
WORKDIR
/go/release
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN
apk update
&&
apk add tzdata
#
RUN apk update && apk add tzdata
COPY
go.mod ./go.mod
RUN
go mod tidy
...
...
@@ -17,10 +17,16 @@ RUN go env && go build -o go-admin .
FROM
alpine
ENV
TZ=Asia/Shanghai
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.4/main/"
>
/etc/apk/repositories
\
&&
apk
--no-cache
add tzdata zeromq
\
&&
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
\
&&
echo
'$TZ'
>
/etc/timezone
COPY
--from=builder /go/release/go-admin /
COPY
--from=builder /go/release/config /config
COPY
--from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE
8053
...
...
This diff is collapsed.
Click to expand it.
PROD.Dockerfile
View file @
840de153
...
...
@@ -5,21 +5,29 @@ ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /go/release
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add tzdata
#
RUN apk update && apk add tzdata
COPY go.mod ./go.mod
RUN go mod tidy
COPY . .
RUN pwd && ls
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
# RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
RUN go env && go build -o go-admin .
FROM alpine
ENV TZ=Asia/Shanghai
RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main/" > /etc/apk/repositories \
&& apk --no-cache add tzdata zeromq \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo '$TZ' > /etc/timezone
COPY --from=builder /go/release/go-admin /
COPY --from=builder /go/release/config /config
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 805
2
EXPOSE 805
4
CMD ["/go-admin","server","-c", "/config/settings.yml"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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