-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 700 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 700 Bytes
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
FROM golang:alpine AS builder
WORKDIR /build
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk add --update --no-cache coreutils && \
apk add --no-cache curl && \
apk add --no-cache make git
ENV GOPROXY https://goproxy.cn
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOARCH=amd64 GOOS=linux make build .
FROM alpine:3
ENV LANG=C.UTF-8
ENV TZ=Asia/Shanghai
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk add --update --no-cache coreutils && \
apk add --no-cache curl
WORKDIR /app
COPY --from=builder /build/dist/sync-image /app/
ENTRYPOINT ["./sync-image"]