File tree 2 files changed +17
-9
lines changed
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
- FROM golang:1.21.4 -alpine AS builder
1
+ FROM golang:1.23.6 -alpine AS builder
2
2
LABEL stage=gobuilder \
3
- mainatiner=https://github.com/mayooot /gpu-docker-api
3
+ mainatiner=https://github.com/XShengTech /gpu-docker-api
4
4
5
- RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
6
- RUN apk add gcc g++ make libffi-dev openssl-dev libtool
5
+ # RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
6
+ RUN apk add gcc g++ make libffi-dev openssl-dev libtool git
7
7
8
8
ENV CGO_ENABLED 0
9
- ENV GOPROXY https://goproxy.cn,direct
9
+ # ENV GOPROXY https://goproxy.cn,direct
10
10
11
11
WORKDIR /build
12
12
@@ -15,14 +15,19 @@ COPY go.sum .
15
15
RUN go mod download
16
16
17
17
COPY . .
18
- RUN make linux_no_ldflags
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
19
24
20
- FROM nvidia/cuda:10.0-base
25
+ FROM ubuntu:22.04
21
26
22
27
VOLUME /data
23
28
WORKDIR /data
24
29
25
- COPY --from=builder /build/bin/ gpu-docker-api-linux-amd64 /data/gpu-docker-api
30
+ COPY --from=builder /build/gpu-docker-api /data/gpu-docker-api
26
31
27
32
EXPOSE 2378
28
33
Original file line number Diff line number Diff line change @@ -35,10 +35,13 @@ services:
35
35
36
36
gpu-docker-api :
37
37
hostname : gpu-docker-api
38
- image : mayooot /gpu-docker-api:v0.0.3
38
+ image : xshengtech /gpu-docker-api:latest
39
39
container_name : gpu-docker-api
40
40
restart : unless-stopped
41
41
network_mode : host
42
+ runtime : nvidia
43
+ environment :
44
+ - APIKEY=CHANGETHIS
42
45
deploy :
43
46
resources :
44
47
reservations :
You can’t perform that action at this time.
0 commit comments