You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 22, 2025. It is now read-only.
@@ -5,13 +5,12 @@ Using Docker allows starting Erigon packaged as a Docker image without installin
5
5
6
6
### General Info
7
7
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>.
15
14
16
15
17
16
## Prerequisites
@@ -48,131 +47,11 @@ docker run -it 36f25992dd1a --chain=holesky --prune.mode=minimal
48
47
49
48
To exit the container press `Ctrl+C`; the container will stop.
50
49
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
-
<divclass="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.
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
172
51
173
52
User UID/GID need to be synchronized between the host OS and container so files are written with correct permission.
174
53
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.
176
55
177
56
```bash
178
57
# create "erigon" user
@@ -181,31 +60,32 @@ make user_linux
181
60
make user_macos
182
61
```
183
62
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
-
186
63
### Environment Variables
187
64
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
191
68
192
-
*`DOCKER_GID` - The GID of the docker user
69
+
* DOCKER_GID - The GID of the docker user
193
70
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
+
```
195
73
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.
197
75
198
76
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`.
199
77
200
78
### Check: Permissions
201
79
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.
203
81
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.
205
83
206
-
Next command starts: Erigon on port 30303, rpcdaemon on port 8545, prometheus on port 9090, and grafana on port 3000:
84
+
### Run
207
85
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
+
```
209
89
#
210
90
# Will mount ~/.local/share/erigon to /home/erigon/.local/share/erigon inside container
`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)
243
123
244
124
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).
245
125
246
-
247
-
126
+
<divclass="warning">
127
+
Windows support for docker-compose is not ready yet.
0 commit comments