Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 42e0bd3

Browse files
authored
Update Dockerfile
1 parent ffd9400 commit 42e0bd3

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

Dockerfile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
1-
FROM golang:1.22 as build
2-
3-
WORKDIR /app
4-
ENV GOPROXY=https://proxy.golang.com.cn,direct
5-
COPY go.mod .
6-
COPY go.sum .
7-
RUN go mod download
8-
9-
COPY . .
1+
FROM alpine
102

11-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o webdav-server main.go
3+
ARG BIN_DIR
4+
ARG TARGETPLATFORM
125

13-
FROM alpine
6+
WORKDIR /
147

15-
COPY --from=build /app/webdav-server /webdav-server
168
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
179
RUN apk add tzdata
1810
ENV TZ=Asia/Shanghai
1911

20-
COPY ./etc /etc
12+
COPY $BIN_DIR/bin-${TARGETPLATFORM//\//_}/storage-server .
2113

22-
EXPOSE 7320
14+
COPY ./etc /etc
2315

24-
USER root
16+
RUN chmod +x storage-server
2517

26-
WORKDIR /
18+
EXPOSE 7320
19+
20+
USER root
2721

28-
CMD ["/webdav-server"]
22+
CMD ["/storage-server"]

0 commit comments

Comments
 (0)