Dockerfile
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/.idea/*
|
||||
14
Dockerfile
14
Dockerfile
@@ -7,18 +7,20 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
ENV GO111MODULE=on
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GOPRIVATE=gitee.com/red-future---jilin-g/*
|
||||
ENV GOTOOLCHAIN=auto
|
||||
ENV GOPRIVATE=gitea.com/red-future/common
|
||||
|
||||
ARG GITEE_TOKEN
|
||||
RUN git config --global url."https://oauth2:cf5eb6b356c7040747eb5eda8b48a617@gitee.com/".insteadOf "https://gitee.com/"
|
||||
# 配置git使用私有Gitea仓库
|
||||
RUN git config --global url."http://x-token-auth:297685158fb953a1bad6c45e16f72472ca6e9866@116.204.74.41:3000/red-future/common.git".insteadOf "https://gitea.com/red-future/common.git" && \
|
||||
git config --global credential.helper store
|
||||
|
||||
# 设置GIT凭据
|
||||
RUN echo "http://x-token-auth:297685158fb953a1bad6c45e16f72472ca6e9866@116.204.74.41:3000" > ~/.git-credentials
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY . .
|
||||
|
||||
# 强制更新 common 包到 master 最新版本
|
||||
RUN go get -u gitee.com/red-future---jilin-g/common@master
|
||||
|
||||
RUN go mod tidy && go mod download
|
||||
|
||||
RUN go build -ldflags="-s -w" -o main ./main.go
|
||||
|
||||
Reference in New Issue
Block a user