-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
30 lines (20 loc) · 886 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM golang:1.23@sha256:7ea4c9dcb2b97ff8ee80a67db3d44f98c8ffa0d191399197007d8459c1453041 AS operator_builder
ARG GO_LDFLAGS=""
ARG BUILD_TIME
ARG CGO_ENABLED=0
ARG GOOS=linux
ARG GOARCH=amd64
WORKDIR /operator
COPY . ./
RUN go mod download
RUN GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=$CGO_ENABLED GO_LDFLAGS=$GO_LDFLAGS \
go build -o slurm_operator ./cmd/
#######################################################################################################################
FROM alpine:latest@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 AS slurm-operator
COPY --from=operator_builder /operator/slurm_operator /usr/bin/
RUN addgroup -S -g 1001 operator && \
adduser -S -u 1001 operator -G operator operator && \
chown 1001:1001 /usr/bin/slurm_operator && \
chmod 500 /usr/bin/slurm_operator
USER 1001
CMD ["/usr/bin/slurm_operator"]