-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 959 Bytes
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 959 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
32
33
34
35
36
37
38
# Build stage
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
# Copy go mod files first for caching
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build arguments for version info
ARG VERSION=dev
ARG COMMIT=none
ARG DATE=unknown
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build \
-tags "exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper,containers_image_openpgp" \
-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}" \
-o /benchmarkoor ./cmd/benchmarkoor
# Final stage
FROM alpine:3.21
RUN apk add --no-cache ca-certificates tzdata git zfs fuse-overlayfs rsync iptables iproute2 && \
if [ "$(uname -m)" = "x86_64" ]; then \
apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing criu; \
fi
WORKDIR /app
COPY --from=builder /benchmarkoor /usr/local/bin/benchmarkoor
ENTRYPOINT ["benchmarkoor"]