Skip to content
This repository was archived by the owner on Dec 22, 2025. It is now read-only.

Commit ea40a7f

Browse files
author
Bloxster
committed
fixed docker general info
1 parent ce8b9b1 commit ea40a7f

File tree

1 file changed

+25
-144
lines changed

1 file changed

+25
-144
lines changed

src/installation/docker.md

Lines changed: 25 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ Using Docker allows starting Erigon packaged as a Docker image without installin
55

66
### General Info
77

8-
- The released archive now comprises 10 key binaries: Erigon, Downloader, Devnet, EVM, Caplin, Diag, Integration, RPCDaemon, Sentry, and Txpool;
9-
- The new Docker images feature seven binaries: Erigon, Integration, Diag, Sentry, Txpool, Downloader, and RPCDaemon (same binaries included in the released archive);
10-
- Multi-platform Docker image available for linux/amd64/v2 and linux/arm64 platforms and based on alpine:3.20.2; No need to pull another Docker image for another different platform.
11-
- The Docker image is now compatible with multiple platforms: Linux (amd64, v2) and arm64. It's built on top of Alpine 3.20.2;
12-
- All build flags now passed to the release workflow — so, user can see previously missed build info in our released binaries (as well as in Docker images) and also better build optimization expected;
13-
- With recent updates, all build configurations are now included in the release process. This provides users with more comprehensive build information for both binaries and Docker images, along with enhanced build optimizations..
14-
- Images are stored at <https://hub.docker.com/r/erigontech/erigon>.
8+
* The new Docker images feature seven binaries as are included in the released archive: `erigon`, `integration`, `diag`, `sentry`, `txpool`, `downloader`, `rpcdaemon`.
9+
* Multi-platform docker image available for linux/amd64/v2 and linux/arm64 platforms and based on alpine:3.20.2; no need to pull another docker image for another different platform.
10+
* All build flags are now passed to the release workflow, allowing users to view previously missed build information in our released binaries and Docker images. Additionally, this change is expected to result in better build optimization.
11+
* Docker images now contain the label “org.opencontainers.image.revision,” which refers to the commit ID from the Erigon project used to build the artifacts.
12+
* With recent updates, all build configurations are now included in the release process. This provides users with more comprehensive build information for both binaries and Docker images, along with enhanced build optimizations.
13+
* Images are stored at <https://hub.docker.com/r/erigontech/erigon>.
1514

1615

1716
## Prerequisites
@@ -48,131 +47,11 @@ docker run -it 36f25992dd1a --chain=holesky --prune.mode=minimal
4847

4948
To exit the container press `Ctrl+C`; the container will stop.
5049

51-
## Docker Compose for basic users
52-
53-
Another option is to use Docker Compose. Docker Compose is a tool for defining and running multi-container Docker applications. It allows users to configure application services using a YAML file to start up all the services with a single command.
54-
55-
For Linux systems, Docker Compose must be installed separately, see instructions [here](https://docs.docker.com/compose/install/).
56-
57-
If you are running Docker on a single-user system, where you're the only user, you don't need to create a dedicated user/group.
58-
59-
<div class="warning">
60-
Windows support for docker-compose is not ready yet.
61-
</div>
62-
63-
### Create a YAML file for Erigon
64-
65-
#### Create a new file called `docker-compose.yml` in a directory of your choice (e.g., `~/erigon`)
66-
67-
The example of the YAML file defines two services: **execution** and **consensus**. Each service has its own configuration, including:
68-
- `container_name`: The name of the container, in this case the network and the prune mode.
69-
- `image`: The Docker image to use.
70-
- `restart`: The restart policy.
71-
- `volumes`: The volumes to mount.
72-
- `networks`: The networks to connect to.
73-
- `ports`: The ports to expose.
74-
- `expose`: The ports to expose.
75-
- `command`: The command to run when the container starts.
76-
- `user`: The user run the container as.
77-
- `logging`: The logging configuration.
78-
79-
The execution service uses the `erigontech/erigon:-latest` image and runs the Erigon client with various options.
80-
81-
```YAML
82-
services:
83-
erigon:
84-
container_name: chiado_minimal
85-
image: erigontech/erigon:main-latest
86-
restart: unless-stopped
87-
volumes:
88-
- $PWD/erigon:/home/erigon/data
89-
ports:
90-
- 30323:30303
91-
- 30323:30303/udp
92-
- 30324:30304
93-
- 30324:30304/udp
94-
- 42089:42069
95-
- 42089:42069/udp
96-
- 4020:4000/udp
97-
- 4021:4001
98-
- 8565:8545
99-
expose:
100-
- 8545
101-
command: |
102-
--prune.mode=minimal
103-
--chain=chiado
104-
--datadir=/home/erigon/data
105-
--http
106-
--http.api=eth,erigon,web3,net,debug,trace,txpool,parity,admin,ots
107-
--http.addr=0.0.0.0
108-
--http.corsdomain=*
109-
--metrics
110-
--metrics.addr=0.0.0.0
111-
--pprof
112-
--pprof.addr=0.0.0.0
113-
--pprof.port=6070
114-
--authrpc.addr=0.0.0.0
115-
--authrpc.jwtsecret=/jwt
116-
--authrpc.vhosts=*
117-
--torrent.download.rate=10mb
118-
--torrent.upload.rate=1mb
119-
user: 0:0
120-
```
121-
122-
### Start the Docker Compose services
123-
124-
Open your terminal into the directory where you created the above docker-compose.yml and type:
125-
126-
```bash
127-
docker compose up -d
128-
```
129-
130-
The containers will start as described in the YAML file, in detached mode. You can verify the output by typing
131-
132-
```bash
133-
docker compose ps
134-
```
135-
136-
To see containers log use:
137-
138-
```bash
139-
docker compose logs -f
140-
```
141-
142-
To stop the containers, you can use the following command:
143-
144-
```bash
145-
docker compose stop
146-
```
147-
148-
This command will stop the containers, but it won't remove them. If you want to remove the containers as well, you can use the following command:
149-
150-
```bash
151-
docker compose down
152-
```
153-
154-
This command will stop and remove the containers, as well as any networks that were created.
155-
156-
157-
## Docker Compose for advanced users
158-
159-
Another option is to use Docker Compose. Docker Compose is a tool for defining and running multi-container Docker applications. It allows users to configure application services using a YAML file to start up all the services with a single command.
160-
161-
> For Linux systems, Docker Compose must be installed separately, see instructions [here](https://docs.docker.com/compose/install/).
162-
163-
### Optional: Setup dedicated user
164-
165-
User UID/GID need to be synchronized between the host OS and container so files are written with correct permission.
166-
167-
You may wish to setup a dedicated user/group on the host OS in order to have improved security and isolation, better resource management and control, easier auditing and logging and reduced risk of compromise impacting the host system.
168-
169-
You can do this by running the following commands:
170-
171-
Optional: Setup dedicated user
50+
## Optional: Setup dedicated user
17251

17352
User UID/GID need to be synchronized between the host OS and container so files are written with correct permission.
17453

175-
You may wish to setup a dedicated user/group on the host OS, in which case the following make targets are available.
54+
You may wish to setup a dedicated user/group on the host OS, in which case the following `make` targets are available.
17655

17756
```bash
17857
# create "erigon" user
@@ -181,31 +60,32 @@ make user_linux
18160
make user_macos
18261
```
18362

184-
You can skip this step if you're running Docker on a single-user system, where you're the only user, since the risks associated with not creating a dedicated user are low.
185-
18663
### Environment Variables
18764

188-
There's a file called `.env.example` in the root of the repository that contains environment variables. These variables are used to configure the Docker containers. The variables are:
189-
190-
* `DOCKER_UID` - The UID of the docker user
65+
There is a `.env.example` file in the root of the repo.
66+
```
67+
* DOCKER_UID - The UID of the docker user
19168
192-
* `DOCKER_GID` - The GID of the docker user
69+
* DOCKER_GID - The GID of the docker user
19370
194-
* `XDG_DATA_HOME` - The data directory which will be mounted to the docker containers
71+
* XDG_DATA_HOME - The data directory which will be mounted to the docker containers
72+
```
19573

196-
If you don't specify these variables, the UID and GID will use the current user's values.
74+
If not specified, the UID/GID will use the current user.
19775

19876
A good choice for `XDG_DATA_HOME` is to use the `~erigon/.ethereum` directory created by helper targets `make user_linux` or `make user_macos`.
19977

20078
### Check: Permissions
20179

202-
Make sure that the `XDG_DATA_HOME` directory (either specified or default) is writable by the `DOCKER_UID` and `DOCKER_GID` in Docker. If you encounter permission issues during the build or service startup, check that the directories, UID, and GID controlled by these environment are correct.
80+
In all cases, `XDG_DATA_HOME` (specified or default) must be writeable by the user UID/GID in docker, which will be determined by the `DOCKER_UID` and `DOCKER_GID` at build time.
20381

204-
### Running the Docker containers
82+
If a build or service startup is failing due to permissions, check that all the directories, UID, and GID controlled by these environment variables are correct.
20583

206-
Next command starts: Erigon on port 30303, rpcdaemon on port 8545, prometheus on port 9090, and grafana on port 3000:
84+
### Run
20785

208-
```yaml
86+
Next command starts: `erigon` on port `30303`, `rpcdaemon` on port `8545`, `prometheus` on port `9090`, and `grafana` on port `3000`:
87+
88+
```
20989
#
21090
# Will mount ~/.local/share/erigon to /home/erigon/.local/share/erigon inside container
21191
#
@@ -239,9 +119,10 @@ ERIGON_USER=erigon
239119
sudo -u ${ERIGON_USER} DOCKER_UID=$(id -u ${ERIGON_USER}) DOCKER_GID=$(id -g ${ERIGON_USER}) XDG_DATA_HOME=~${ERIGON_USER}/.ethereum DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 make docker-compose
240120
```
241121

242-
`Makefile` creates the initial directories for Erigon, Prometheus and Grafana. The PID namespace is shared between erigon and rpcdaemon which is required to open Erigon's DB from another process (RPCDaemon local-mode). See: [https://github.com/ledgerwatch/erigon/pull/2392/files](https://github.com/ledgerwatch/erigon/pull/2392/files)
122+
`makefile` creates the initial directories for `erigon`, `prometheus` and `grafana`. The PID namespace is shared between erigon and rpcdaemon which is required to open Erigon's DB from another process (RPCDaemon local-mode). See: [https://github.com/ledgerwatch/erigon/pull/2392/files](https://github.com/ledgerwatch/erigon/pull/2392/files)
243123

244124
If your docker installation requires the docker daemon to run as root (which is by default), you will need to prefix the command above with `sudo`. However, it is sometimes recommended running docker (and therefore its containers) as a non-root user for security reasons. For more information about how to do this, refer to this [article](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).
245125

246-
247-
126+
<div class="warning">
127+
Windows support for docker-compose is not ready yet.
128+
</div>

0 commit comments

Comments
 (0)