-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathl1challengeperiod.Dockerfile
More file actions
38 lines (27 loc) · 1.04 KB
/
l1challengeperiod.Dockerfile
File metadata and controls
38 lines (27 loc) · 1.04 KB
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
# --- STAGE 1: Build the binary ---
FROM golang:1.25-alpine AS builder
# Install necessary tools (for CGO or general build needs)
RUN apk add --no-cache build-base
# Enable CGO (can be disabled if not using C deps)
ENV CGO_ENABLED=1
# Set working directory to match your repo root
WORKDIR /home/obscuro/go-obscuro
# Copy mod files early for caching
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy full codebase
COPY . .
# Set working dir to the script's package
WORKDIR /home/obscuro/go-obscuro/testnet/launcher/l1challengeperiod/cmd
# Build the binary (output name is optional but useful)
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -o l1challengeperiod
# --- STAGE 2: Slim runtime image ---
FROM alpine:3.18
# Copy built binary into the runtime image
COPY --from=builder /home/obscuro/go-obscuro/testnet/launcher/l1challengeperiod/cmd/l1challengeperiod /usr/local/bin/l1challengeperiod
# Set working directory (optional)
WORKDIR /usr/local/bin
# Default command to run the script
ENTRYPOINT ["/usr/local/bin/l1challengeperiod"]