forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 831 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
31
32
33
34
# Changes to the minimum golang version must also be replicated in
# scripts/build_avalanche.sh
# tests/antithesis/Dockerfile.node
# tests/antithesis/Dockerfile.workload
# Dockerfile (here)
# README.md
# go.mod
# ============= Compilation Stage ================
FROM golang:1.21.8-bullseye AS builder
WORKDIR /build
# Copy and download avalanche dependencies using go mod
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy the code into the container
COPY . .
# Build avalanchego
ARG RACE_FLAG=""
RUN ./scripts/build.sh ${RACE_FLAG}
# ============= Cleanup Stage ================
FROM debian:11-slim AS execution
# Maintain compatibility with previous images
RUN mkdir -p /avalanchego/build
WORKDIR /avalanchego/build
# Copy the executables into the container
COPY --from=builder /build/build/ .
CMD [ "./avalanchego" ]