init project
This commit is contained in:
1 parent
aee8bcc886
commit
a82a843b76
9 files changed
+20
-11
No files matched your search
+7
-3
@@ -1,10 +1,14 @@
|
||||
FROM golang:1.27.3-alpine AS builder
|
||||
RUN apk add --no-cache git openssh-client
|
||||
ENV GOPRIVATE=git.vitatech.com.cn
|
||||
RUN git config --global url."ssh://git@git.vitatech.com.cn:12222/".insteadOf "https://git.vitatech.com.cn/" \
|
||||
&& mkdir -p -m 0700 /root/.ssh
|
||||
WORKDIR /src
|
||||
COPY proto/go.mod proto/go.sum ./proto/
|
||||
COPY gin_layout/go.mod gin_layout/go.sum ./gin_layout/
|
||||
WORKDIR /src/gin_layout
|
||||
RUN go mod download
|
||||
COPY proto /src/proto
|
||||
RUN --mount=type=ssh,required=true \
|
||||
--mount=type=secret,id=git_known_hosts,target=/root/.ssh/known_hosts,required=true \
|
||||
go mod download
|
||||
COPY gin_layout /src/gin_layout
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /out/api ./cmd/api
|
||||
|
||||
|
||||
Reference in new issue
Block a user