Skip to content

Commit 0271c16

Browse files
committed
[Fix] 🐛 Build Info Print Error at Docker Image Builder
1 parent 73c2c41 commit 0271c16

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ LABEL stage=gobuilder \
55
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
66
RUN apk add gcc g++ make libffi-dev openssl-dev libtool git
77

8-
ENV CGO_ENABLED 0
9-
# ENV GOPROXY https://goproxy.cn,direct
8+
ENV CGO_ENABLED=0
9+
# ENV GOPROXY=https://goproxy.cn,direct
1010

1111
WORKDIR /build
1212

@@ -15,19 +15,14 @@ COPY go.sum .
1515
RUN go mod download
1616

1717
COPY . .
18-
RUN BRANCH=$(git rev-parse --abbrev-ref HEAD) && \
19-
VERSION=$(git describe --tags | cut -d'-' -f1) && \
20-
COMMIT=$(git rev-parse --short HEAD) && \
21-
GO_VERSION=$(go env GOVERSION) && \
22-
BUILD_TIME=$(date +%FT%T%z) && \
23-
go build -ldflags="-s -w -X main.BRANCH=${BRANCH} -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT} -X main.GoVersion=${GO_VERSION} -X main.BuildTime=${BUILD_TIME}" -trimpath -o gpu-docker-api cmd/gpu-docker-api/main.go
18+
RUN make linux
2419

2520
FROM ubuntu:22.04
2621

2722
VOLUME /data
2823
WORKDIR /data
2924

30-
COPY --from=builder /build/gpu-docker-api /data/gpu-docker-api
25+
COPY --from=builder /build/bin/gpu-docker-api-linux-amd64 /data/gpu-docker-api
3126

3227
EXPOSE 2378
3328

0 commit comments

Comments
 (0)