Skip to content

Commit c17e674

Browse files
authored
Merge branch 'main' into fix-config-name-not-base-config
2 parents 4d2e1db + 3ef846a commit c17e674

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ tmp/
1717
flake.*
1818
native/**/target/
1919
Dockerfile
20+
*.pb.ex
21+
*.pb.go

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ jobs:
133133
- name: Run dialyzer
134134
run: mix dialyzer --no-check
135135

136+
docker-build:
137+
name: Build Docker image
138+
runs-on: ubuntu-22.04
139+
steps:
140+
- uses: actions/checkout@v4
141+
- name: Set up Docker Buildx
142+
uses: docker/setup-buildx-action@v1
143+
- name: Build Docker image
144+
uses: docker/build-push-action@v2
145+
with:
146+
context: .
147+
file: ./Dockerfile
148+
load: true # Important for building without pushing
149+
136150
smoke:
137151
name: Start and stop the node
138152
needs: [compile-native, download-beacon-node-oapi]

Dockerfile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
FROM golang:1.21.3 AS libp2p_builder
33
LABEL stage=builder
44

5+
# Install dependencies
6+
RUN apt-get update && apt-get install -y protobuf-compiler
7+
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
8+
59
RUN mkdir /libp2p_port
610
WORKDIR /libp2p_port
711

812
COPY native/libp2p_port /libp2p_port
13+
COPY proto/libp2p.proto /libp2p_port/proto/libp2p.proto
914

10-
RUN go build -o libp2p_port
15+
RUN protoc --go_out=./ proto/libp2p.proto
1116

17+
RUN go mod download
18+
RUN go build -o libp2p_port
1219

1320
# Main image
1421
FROM elixir:1.16.2-otp-26
@@ -21,15 +28,23 @@ ENV MIX_ENV=prod
2128
RUN mix local.hex --force
2229

2330
# Install dependencies
24-
RUN apt-get update && apt-get install -y cmake
31+
RUN apt-get update && apt-get install -y cmake protobuf-compiler
32+
33+
# Install protobuf for elixir
34+
RUN mix escript.install --force hex protobuf
2535

2636
# Install rust
2737
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
28-
ENV PATH="${PATH}:/root/.cargo/bin"
38+
39+
ENV PATH="${PATH}:/root/.cargo/bin:/root/.mix/escripts"
2940

3041
COPY . .
3142
COPY --from=libp2p_builder /libp2p_port/libp2p_port /consensus/priv/native/libp2p_port
3243

44+
RUN protoc --elixir_out=./lib proto/libp2p.proto
45+
46+
RUN make download-beacon-node-oapi
47+
3348
RUN mix deps.get
3449
RUN mix compile
3550

0 commit comments

Comments
 (0)