-
-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (17 loc) · 682 Bytes
/
Dockerfile
File metadata and controls
28 lines (17 loc) · 682 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
FROM golang:1.24.11-alpine AS build
ARG VERSION
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /root
COPY . /root
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories \
&& apk upgrade && apk add --no-cache --virtual .build-deps \
ca-certificates upx tzdata
RUN CGO_ENABLED=0 go build --ldflags="-X main.Version=${VERSION}" -o w8t ./cmd/main.go \
&& chmod +x w8t
FROM alpine:3.19
COPY --from=build /root/w8t /app/w8t
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories \
&& apk upgrade && apk add --no-cache --virtual .build-deps \
ca-certificates upx tzdata
WORKDIR /app
ENTRYPOINT ["/app/w8t"]