Skip to content

Commit

Permalink
Fix Docker run -p for both TCP and UDP (#340)
Browse files Browse the repository at this point in the history
Issue Addressed

[Docker run] ... "-p 9000:9000" defaults to expose TCP only.

Proposed Changes

Add "-p 9000:9000/udp" for UDP peer discovery.

Additional Notes

apply changes to docker-compose parameters accordingly

Co-authored-by: bgravenorst <50852695+bgravenorst@users.noreply.github.com>
  • Loading branch information
ladidan and bgravenorst authored Feb 16, 2022
1 parent 5002f4a commit 51400ec
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions docs/HowTo/Get-Started/Installation-Options/Run-Docker-Image.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ docker image instead of the command line options.
!!! Example "Example using Environment variables and CLI options"

```bash
docker run -d -p 9000:9000 -p 5051:5051 -e TEKU_REST_API_ENABLED=true -e TEKU_P2P_PORT=9000 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --network=prater --eth1-endpoint=http://102.10.10.1:8545 --validator-keys=/var/lib/teku/validator/keys:/var/lib/teku/validator/passwords --data-path=/var/lib/teku --log-destination=CONSOLE
docker run -d -p 9000:9000/tcp -p 9000:9000/udp -p 5051:5051 -e TEKU_REST_API_ENABLED=true -e TEKU_P2P_PORT=9000 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --network=prater --eth1-endpoint=http://102.10.10.1:8545 --validator-keys=/var/lib/teku/validator/keys:/var/lib/teku/validator/passwords --data-path=/var/lib/teku --log-destination=CONSOLE
```

!!! tips
Expand All @@ -49,7 +49,7 @@ docker container.
!!! example

```bash
docker run -p 9000:9000 --user 1001:1001 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --data-base-path=/var/lib/teku --network=prater --eth1-endpoint=http://102.10.10.1:8545 --validator-keys=/var/lib/teku/validator/keys:/var/lib/teku/validator/passwords
docker run -p 9000:9000/tcp -p 9000:9000/udp --user 1001:1001 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --data-base-path=/var/lib/teku --network=prater --eth1-endpoint=http://102.10.10.1:8545 --validator-keys=/var/lib/teku/validator/keys:/var/lib/teku/validator/passwords
```

## Exposing ports
Expand All @@ -65,13 +65,13 @@ specified using:
To run Teku exposing local ports for access:

```bash
docker run -p <localportP2P>:30303 -p <localportREST>:5051 consensys/teku:latest --network=<NETWORK> --data-base-path=<DATA_DIR> --eth1-endpoint=<URL> --validator-keys=<KEY_DIR>:<PASS_DIR> --rest-api-enabled=true
docker run -p <localportP2P>:30303/tcp -p <localportP2P>:30303/udp -p <localportREST>:5051 consensys/teku:latest --network=<NETWORK> --data-base-path=<DATA_DIR> --eth1-endpoint=<URL> --validator-keys=<KEY_DIR>:<PASS_DIR> --rest-api-enabled=true
```

!!! example

```
docker run -p 30303:30303 -p 5051:5051 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --network=prater --data-base-path=/var/lib/teku --eth1-endpoint=http://102.10.10.1:8545 --validator-keys=/var/lib/teku/validator/keys:/var/lib/teku/validator/passwords --rest-api-enabled=true
docker run -p 30303:30303/tcp -p 30303:30303/udp -p 5051:5051 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --network=prater --data-base-path=/var/lib/teku --eth1-endpoint=http://102.10.10.1:8545 --validator-keys=/var/lib/teku/validator/keys:/var/lib/teku/validator/passwords --rest-api-enabled=true
```

## Run Teku using Docker Compose
Expand Down Expand Up @@ -111,7 +111,8 @@ to start the container.
ports:
# Map the p2p port(30303) and RPC HTTP port(8545)
- "8545:8545"
- "30303:30303"
- "30303:30303/tcp"
- "30303:30303/udp"

teku_node:
environment:
Expand All @@ -130,7 +131,8 @@ to start the container.
- ./teku:/opt/teku/data
ports:
# Map the p2p port(9000) and REST API port(5051)
- "9000:9000"
- "9000:9000/tcp"
- "9000:9000/udp"
- "5051:5051"
```

Expand All @@ -153,7 +155,8 @@ to start the container.
ports:
# Map the p2p port(30303) and RPC HTTP port(8545)
- "8545:8545"
- "30303:30303"
- "30303:30303/tcp"
- "30303:30303/udp"

teku_node:
environment:
Expand All @@ -171,7 +174,8 @@ to start the container.
- ./teku:/opt/teku/data
ports:
# Map the p2p port(9000) and REST API port(5051)
- "9000:9000"
- "9000:9000/tcp"
- "9000:9000/udp"
- "5051:5051"
```

Expand Down

0 comments on commit 51400ec

Please sign in to comment.