-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM golang:1.19 as builder | ||
ENV GOPROXY=https://goproxy.cn,https://goproxy.io,direct | ||
ENV GO111MODULE=on | ||
ENV GOCACHE=/go/pkg/.cache/go-build | ||
|
||
WORKDIR /work | ||
ADD . . | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /usr/local/bin/ylgy github.com/zc2638/ylgy/cmd/ylgy | ||
|
||
FROM alpine:3.6 as alpine | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \ | ||
apk update && \ | ||
apk add -U --no-cache ca-certificates tzdata | ||
|
||
FROM alpine:3.6 | ||
MAINTAINER zc | ||
LABEL maintainer="zc" \ | ||
email="[email protected]" | ||
|
||
ENV TZ="Asia/Shanghai" | ||
|
||
COPY --from=alpine /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /usr/local/bin/ylgy /usr/local/bin/ylgy | ||
|
||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ | ||
echo $TZ > /etc/timezone | ||
|
||
WORKDIR /work | ||
CMD ["ylgy"] |