-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (28 loc) · 1.17 KB
/
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
35
36
37
38
# ============= Compilation Stage ================
FROM golang:1.21.11-bullseye AS builder
ARG LUX_VERSION
RUN mkdir -p $GOPATH/src/github.com/luxfi
WORKDIR $GOPATH/src/github.com/luxfi
RUN git clone -b $LUX_VERSION --single-branch https://github.com/luxfi/node.git
# Copy coreth repo into desired location
COPY . coreth
# Set the workdir to Lux Node and update coreth dependency to local version
WORKDIR $GOPATH/src/github.com/luxfi/node
# Run go mod download here to improve caching of Lux Node specific depednencies
RUN go mod download
# Replace the coreth dependency
RUN go mod edit -replace github.com/luxfi/coreth=../coreth
RUN go mod download && go mod tidy -compat=1.21
# Build the Lux Node binary with local version of coreth.
RUN ./scripts/build_lux.sh
# Create the plugins directory in the standard location so the build directory will be recognized
# as valid.
RUN mkdir build/plugins
# ============= Cleanup Stage ================
FROM debian:11-slim AS execution
# Maintain compatibility with previous images
RUN mkdir -p /node/build
WORKDIR /node/build
# Copy the executables into the container
COPY --from=builder /go/src/github.com/luxfi/node/build .
CMD [ "./node" ]