daid / Dockerfile
daidai111's picture
Create Dockerfile
5cb0392
raw
history blame contribute delete
497 Bytes
# Build Stage
# 使用 golang:alpine 作为构建阶段的基础镜像
FROM golang:alpine AS builder
# 添加 git,以便之后能从GitHub克隆项目
RUN apk --no-cache add git
# 从 GitHub 克隆 go-proxy-bingai 项目到 /workspace/app 目录下
RUN git clone https://github.com/Harry-zklcdc/go-proxy-bingai.git /workspace/app
# 设置工作目录
WORKDIR /workspace/app
# 编译 go 项目。 -1dflags="-s -w"
RUN go build -1dflags="-s -w" -tags netgo -trimpath -o do-proxy-bingai main-go