Skip to content

Commit c699e86

Browse files
Merge pull request #25 from socialcode-rob1/bugfix/depending-on-old-casper-client
add client branch option to docker build
2 parents fb12340 + 3657336 commit c699e86

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# python env and test outputs
2+
env/*
3+
test/__pycache__/*

BUILD.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@
55
To build the NCTL docker image run `docker build` as follows:
66

77
```bash
8-
docker build -f casper-nctl.Dockerfile --build-arg GITBRANCH=release-1.4.15 -t casper-nctl:v1415 .
8+
docker build -f casper-nctl.Dockerfile --build-arg NODE_GITBRANCH=release-1.5.4 --build-arg CLIENT_GITBRANCH=release-2.0.0 -t casper-nctl:v154 .
99
```
1010

11-
The argument `GITBRANCH` indicates which branch from the `casper-node` repository docker
11+
The argument `NODE_GITBRANCH` indicates which branch from the `casper-node` repository docker
1212
will download and build.
1313

14-
In the command above, the image is tagged as v144, which is the latest `casper-node` version
14+
The argument `CLIENT_GITBRANCH` indicates which branch from the `casper-client-rs` repository docker
15+
will download and build.
16+
17+
In the command above, the image is tagged as v154, which is the latest `casper-node` version
1518
at the moment of writing these instructions. To keep other scripts independent of the version,
1619
tag the image also as `latest` once the first build completes.
1720

1821
```bash
19-
docker tag casper-nctl:v1415 casper-nctl:latest
22+
docker tag casper-nctl:v154 casper-nctl:latest
2023
```
2124

2225
## Test the docker image
@@ -31,7 +34,7 @@ pip install pytest testinfra
3134
Then, run `pytest` indicating the name of the docker image to test:
3235

3336
```
34-
pytest --image casper-nctl:v144
37+
pytest --image casper-nctl:v154
3538
```
3639

3740
## Configure Docker Hub Automated Builds

casper-nctl.Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM ubuntu:focal
22

3-
ARG GITBRANCH=release-1.4.15
3+
ARG NODE_GITBRANCH=release-1.4.15
4+
ARG CLIENT_GITBRANCH=main
45

56
# DEBIAN_FRONTEND required for tzdata dependency install
67
RUN apt-get update \
@@ -28,9 +29,9 @@ ENV NCTL_COMPILE_TARGET="release"
2829
# clone the casper-node repos and build binaries
2930
RUN git clone https://github.com/casper-network/casper-node-launcher.git ~/casper-node-launcher \
3031
&& cd ~/casper-node-launcher && cargo build --release
31-
RUN git clone -b main https://github.com/casper-ecosystem/casper-client-rs ~/casper-client-rs \
32+
RUN git clone -b $CLIENT_GITBRANCH https://github.com/casper-ecosystem/casper-client-rs ~/casper-client-rs \
3233
&& cd ~/casper-client-rs && cargo build --release
33-
RUN git clone -b $GITBRANCH https://github.com/casper-network/casper-node.git ~/casper-node \
34+
RUN git clone -b $NODE_GITBRANCH https://github.com/casper-network/casper-node.git ~/casper-node \
3435
&& source ~/casper-node/utils/nctl/sh/assets/compile.sh
3536

3637
# run clean-build-artifacts.sh to remove intermediate files and keep the image lighter

0 commit comments

Comments
 (0)