Skip to content

Commit 0be57ee

Browse files
authored
Don't package the nimbus_validator_client in the nimbus-eth2 docker images; Document the new dedicated image (#4441)
1 parent 94a87da commit 0be57ee

File tree

5 files changed

+29
-34
lines changed

5 files changed

+29
-34
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
cd ../docker/dist/binaries
5454
REFNAME="${{ github.ref }}"
5555
TAG="${REFNAME#refs/tags/}"
56-
DOCKER_BUILDKIT=1 docker build -f Dockerfile.amd64 -t statusim/nimbus-eth2:amd64-${TAG} -t statusim/nimbus-eth2:amd64-latest .
56+
DOCKER_BUILDKIT=1 docker build -f Dockerfile.bn.amd64 -t statusim/nimbus-eth2:amd64-${TAG} -t statusim/nimbus-eth2:amd64-latest .
5757
docker push statusim/nimbus-eth2:amd64-${TAG}
5858
docker push statusim/nimbus-eth2:amd64-latest
5959
@@ -132,7 +132,7 @@ jobs:
132132
TAG="${REFNAME#refs/tags/}"
133133
cp -a /usr/bin/qemu-aarch64-static .
134134
135-
DOCKER_BUILDKIT=1 docker build -f Dockerfile.arm64 -t statusim/nimbus-eth2:arm64-${TAG} -t statusim/nimbus-eth2:arm64-latest .
135+
DOCKER_BUILDKIT=1 docker build -f Dockerfile.bn.arm64 -t statusim/nimbus-eth2:arm64-${TAG} -t statusim/nimbus-eth2:arm64-latest .
136136
docker push statusim/nimbus-eth2:arm64-${TAG}
137137
docker push statusim/nimbus-eth2:arm64-latest
138138
@@ -210,7 +210,7 @@ jobs:
210210
REFNAME="${{ github.ref }}"
211211
TAG="${REFNAME#refs/tags/}"
212212
cp -a /usr/bin/qemu-arm-static .
213-
DOCKER_BUILDKIT=1 docker build -f Dockerfile.arm -t statusim/nimbus-eth2:arm-${TAG} -t statusim/nimbus-eth2:arm-latest .
213+
DOCKER_BUILDKIT=1 docker build -f Dockerfile.bn.arm -t statusim/nimbus-eth2:arm-${TAG} -t statusim/nimbus-eth2:arm-latest .
214214
docker push statusim/nimbus-eth2:arm-${TAG}
215215
docker push statusim/nimbus-eth2:arm-latest
216216

docker/dist/binaries/Dockerfile.amd64 renamed to docker/dist/binaries/Dockerfile.bn.amd64

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ USER user
1010

1111
STOPSIGNAL SIGINT
1212

13-
# Docker refuses to copy the source directory here, so read it as "nimbus-eth2/*"
14-
COPY "nimbus-eth2" "/home/user/nimbus-eth2/"
15-
WORKDIR "/home/user/nimbus-eth2/"
16-
ENTRYPOINT ["/home/user/nimbus-eth2/build/nimbus_beacon_node"]
17-
13+
COPY "nimbus-eth2/build/nimbus_beacon_node" "/home/user/nimbus_beacon_node"
14+
WORKDIR "/home/user/"
15+
ENTRYPOINT ["/home/user/nimbus_beacon_node"]

docker/dist/binaries/Dockerfile.arm renamed to docker/dist/binaries/Dockerfile.bn.arm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ USER user
1414

1515
STOPSIGNAL SIGINT
1616

17-
# Docker refuses to copy the source directory here, so read it as "nimbus-eth2/*"
18-
COPY "nimbus-eth2" "/home/user/nimbus-eth2/"
19-
WORKDIR "/home/user/nimbus-eth2/"
20-
ENTRYPOINT ["/home/user/nimbus-eth2/build/nimbus_beacon_node"]
21-
17+
COPY "nimbus-eth2/build/nimbus_beacon_node" "/home/user/nimbus_beacon_node"
18+
WORKDIR "/home/user/"
19+
ENTRYPOINT ["/home/user/nimbus_beacon_node"]

docker/dist/binaries/Dockerfile.arm64 renamed to docker/dist/binaries/Dockerfile.bn.arm64

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ USER user
1414

1515
STOPSIGNAL SIGINT
1616

17-
# Docker refuses to copy the source directory here, so read it as "nimbus-eth2/*"
18-
COPY "nimbus-eth2" "/home/user/nimbus-eth2/"
19-
WORKDIR "/home/user/nimbus-eth2/"
20-
ENTRYPOINT ["/home/user/nimbus-eth2/build/nimbus_beacon_node"]
21-
17+
COPY "nimbus-eth2/build/nimbus_beacon_node" "/home/user/nimbus_beacon_node"
18+
WORKDIR "/home/user/"
19+
ENTRYPOINT ["/home/user/nimbus_beacon_node"]

docs/the_nimbus_book/src/docker.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
11
# Docker images
22

3-
Docker images are available from [Docker Hub](https://hub.docker.com/r/statusim/nimbus-eth2) .
3+
Docker images for the [Nimbus beacon node](https://hub.docker.com/r/statusim/nimbus-eth2) and the [Nimbus validator client](https://hub.docker.com/r/statusim/nimbus-validator-client) are available at docker hub.
44

5-
We have version-specific Docker tags (`statusim/nimbus-eth2:amd64-v1.2.3`) and a tag for the latest image (`statusim/nimbus-eth2:amd64-latest`).
5+
We have version-specific Docker tags (e.g. `statusim/nimbus-eth2:amd64-v1.2.3`) and a tag for the latest image (e.g. `statusim/nimbus-eth2:amd64-latest`).
66

7-
These images are simply the contents of [release tarballs](./binaries.md) inside a `debian:bullseye-slim` image, running under a user imaginatively named `user`, with UID:GID of 1000:1000.
7+
These images contain the same binaries as the [release tarballs](./binaries.md) inside a `debian:bullseye-slim` image, running under a user imaginatively named `user`, with UID:GID of 1000:1000.
88

9-
The unpacked archive is in `/home/user/nimbus-eth2` which is also the default *WORKDIR*. The default *ENTRYPOINT* is the binary itself: `/home/user/nimbus-eth2/build/nimbus_beacon_node`
9+
The binaries are placed under the `/home/user/` directory which is also the default *WORKDIR*. The *ENTRYPOINT* of the image is configured to directly launch the respective binary without any extra arguments.
1010

1111
## Usage
1212

1313
Before running Nimbus via docker, you need to prepare a data directory and mount it in docker.
1414

15-
It is recommended that you mount the directory at `/home/user/nimbus-eth2/build/data` and pass `--data-dir=build/data/shared_mainnet_0` to all `nimbus_beacon_node` commands.
16-
17-
The wrapper script outlined below will set the data directory automatically.
15+
It is recommended that you mount the directory at `/home/user/data` and pass `--data-dir=data/beacon_node/mainnet_0` to all `nimbus_beacon_node` commands.
1816

1917
```sh
2018
mkdir data
2119
docker run -it --rm \
22-
-v ${PWD}/data:/home/user/nimbus-eth2/build/data \
20+
-v ${PWD}/data:/home/user/data \
2321
statusim/nimbus-eth2:amd64-latest \
24-
--data-dir=build/data/shared_mainnet_0
25-
--network=mainnet [other options]
22+
--data-dir=data/beacon_node/mainnet_0
23+
--network=mainnet \
24+
[other options]
2625
```
2726

28-
### Wrapper script
29-
30-
If you wish, you can choose to use a wrapper script instead:
27+
Similarly, to launch a Nimbus validator client you can use the following command:
3128

3229
```sh
3330
mkdir data
3431
docker run -it --rm \
35-
-v ${PWD}/data:/home/user/nimbus-eth2/build/data \
36-
--entrypoint /home/user/nimbus-eth2/run-mainnet-beacon-node.sh \
37-
statusim/nimbus-eth2:amd64-latest [other options]
32+
-v ${PWD}/data:/home/user/data \
33+
statusim/nimbus-validator_client:amd64-latest \
34+
--data-dir=data/validator_client/mainnet_0 \
35+
[other options]
3836
```
3937

38+
!!! warning
39+
Do not use the same data directory for beacon node and validator client - they will both try to load the same keys which may result in slashing!
40+
4041
### Docker compose
4142

4243
Our preferred setup is using `docker-compose`. You can use one of our [example configuration files](https://github.com/status-im/nimbus-eth2/tree/stable/docker/dist/binaries) as a base for your own custom configuration:

0 commit comments

Comments
 (0)