-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 777 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 777 Bytes
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
31
# Build stage
FROM golang:1.23 as builder
# Set the Current Working Directory inside the container
RUN mkdir /server
WORKDIR /server
# Copy the source code into the container
COPY github-runner-scaler.go /server
# Initialize the Go module and download dependencies
# RUN go mod init gopkg.in/yaml.v2 \
# && go mod tidy
ENV GO111MODULE=on
ENV GOROOT=/usr/local/go
RUN go mod init server && go mod tidy
# Build the Go app
RUN CGO_ENABLED=0 go build -o github-runner-scaler github-runner-scaler.go
# Final stage
FROM gcr.io/distroless/base
# Copy the Go binary from the builder stage
COPY --from=builder /server/github-runner-scaler /github-runner-scaler
# Use an unprivileged user
USER 65534:65534
# Command to run the executable
ENTRYPOINT ["/github-runner-scaler"]