Skip to content

Commit cd33711

Browse files
committed
add dockerfile
1 parent d800122 commit cd33711

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# syntax=docker/dockerfile:experimental
2+
3+
# ============= Setting up base Stage ================
4+
# Set required AVALANCHE_VERSION parameter in build image script
5+
ARG AVALANCHE_VERSION=1.7.4
6+
7+
# ============= Compilation Stage ================
8+
FROM golang:1.17.1-buster AS builder
9+
RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64
10+
11+
WORKDIR /build
12+
# Copy and download avalanche dependencies using go mod
13+
COPY go.mod .
14+
COPY go.sum .
15+
RUN go mod download
16+
17+
# Copy the code into the container
18+
COPY . .
19+
20+
RUN ./scripts/build.sh /build/spaces
21+
22+
# ============= Cleanup Stage ================
23+
FROM avaplatform/avalanchego:$AVALANCHE_VERSION AS builtImage
24+
25+
# Copy the evm binary into the correct location in the container
26+
COPY --from=builder /build/spaces /avalanchego/build/plugins/spaces

0 commit comments

Comments
 (0)