Compare commits

...

2 Commits

Author SHA1 Message Date
Stille 96d00b6858
Merge pull request #38 from Winson-030/patch-2
Update Dockerfile from upstream CareyWang/MyUrls
2024-05-02 22:30:20 +08:00
Winson Lee 98f0997a73
Update Dockerfile from upstream CareyWang/MyUrls 2024-05-02 22:23:20 +08:00
1 changed files with 2 additions and 2 deletions

View File

@ -1,11 +1,11 @@
FROM golang:1.20-alpine AS build
FROM golang:1.22-alpine AS build
ARG TARGETARCH
RUN apk add --update git
RUN git clone https://github.com/CareyWang/MyUrls /app
WORKDIR /app
RUN go env -w GO111MODULE="on" && go env -w GOPROXY="https://goproxy.cn,direct"
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o myurls main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o myurls
FROM alpine:latest
WORKDIR /app