瀏覽代碼

Update Dockerfile from upstream CareyWang/MyUrls

Winson Lee 1 年之前
父節點
當前提交
98f0997a73
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      myurls/Dockerfile

+ 2 - 2
myurls/Dockerfile

@@ -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