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 Nov 15, 2023. It is now read-only.
* WIP
* Add missing checkout
* Add debuggin
* Fix VAR name
* Bug fix
* Rework jobs
* Revert "Rework jobs"
This reverts commit 2bfa79f.
* Add cache
* Add temp default for testing
* Add missing checkout
* Fix patch
* Comment out the GPG check for now
* Rename polkadot_injected_release into a more appropriate polkadot_injected_debian
* Refactoring / renaming
* Introduce a generic image for binary injection
* Flag files to be deleted and changes to be done
* WIP
* Fix multi binaries images
* Add test build scripts
* Remove old file, add polkadot build-injected script
* Fix doc
* Fix tagging
* Add build of the injected container
* Fix for docker
* Remove the need for TTY
* Handling container publishing
* Fix owner and registry
* Fix vars
* Fix repo
* Fix var naming
* Fix case when there is no tag
* Fix case with no tag
* Handle error
* Fix spacings
* Fix tags
* Remove unnecessary grep that may fail
* Add final check
* Clean up and introduce GPG check
* Add doc
* Add doc
* Update doc/docker.md
Co-authored-by: Mira Ressel <mira@parity.io>
* type
Co-authored-by: Mira Ressel <mira@parity.io>
* Fix used VAR
* Improve doc
* ci: Update .build-push-image jobs to use the new build-injected.sh
* ci: fix path to build-injected.sh script
* Rename the release artifacts folder to prevent confusion due to a similar folder in the gitlab CI
* ci: check out polkadot repo in .build-push-image
This seems far cleaner than copying the entire scripts/ folder into our
job artifacts.
* feat(build-injected.sh): make PROJECT_ROOT configurable
This lets us avoid a dependency on git in our CI image.
* ci: build injected images with buildah
* ci: pass full image names to zombienet
* Add missing ignore
---------
Co-authored-by: Mira Ressel <mira@parity.io>
The following commands should work no matter if you use Docker or Podman. In general, Podman is recommended. All commands are "engine neutral" so you can use the container engine of your choice while still being able to copy/paste the commands below.
4
+
5
+
Let's start defining Podman as our engine:
6
+
```
7
+
ENGINE=podman
8
+
```
9
+
10
+
If you prefer to stick with Docker, use:
11
+
```
12
+
ENGINE=docker
13
+
```
2
14
3
15
## The easiest way
4
16
5
-
The easiest/faster option to run Polkadot in Docker is to use the latest release images. These are small images that use the latest official release of the Polkadot binary, pulled from our package repository.
17
+
The easiest/faster option to run Polkadot in Docker is to use the latest release images. These are small images that use the latest official release of the Polkadot binary, pulled from our Debian package.
6
18
7
-
**_Following examples are running on westend chain and without SSL. They can be used to quick start and learn how Polkadot needs to be configured. Please find out how to secure your node, if you want to operate it on the internet. Do not expose RPC and WS ports, if they are not correctly configured._**
19
+
**_The following examples are running on westend chain and without SSL. They can be used to quick start and learn how Polkadot needs to be configured. Please find out how to secure your node, if you want to operate it on the internet. Do not expose RPC and WS ports, if they are not correctly configured._**
8
20
9
21
Let's first check the version we have. The first time you run this command, the Polkadot docker image will be downloaded. This takes a bit of time and bandwidth, be patient:
10
22
11
23
```bash
12
-
docker run --rm -it parity/polkadot:latest --version
24
+
$ENGINE run --rm -it parity/polkadot:latest --version
13
25
```
14
26
15
27
You can also pass any argument/flag that Polkadot supports:
16
28
17
29
```bash
18
-
docker run --rm -it parity/polkadot:latest --chain westend --name "PolkaDocker"
30
+
$ENGINE run --rm -it parity/polkadot:latest --chain westend --name "PolkaDocker"
19
31
```
20
32
21
33
## Examples
22
34
23
-
Once you are done experimenting and picking the best node name :) you can start Polkadot as daemon, exposes the Polkadot ports and mount a volume that will keep your blockchain data locally. Make sure that you set the ownership of your local directory to the Polkadot user that is used by the container. Set user id 1000 and group id 1000, by running `chown 1000.1000 /my/local/folder -R` if you use a bind mount.
24
-
25
-
To start a Polkadot node on default rpc port 9933 and default p2p port 30333 use the following command. If you want to connect to rpc port 9933, then must add Polkadot startup parameter: `--rpc-external`.
35
+
Once you are done experimenting and picking the best node name :) you can start Polkadot as daemon, exposes the Polkadot ports and mount a volume that will keep your blockchain data locally. Make sure that you set the ownership of your local directory to the Polkadot user that is used by the container.
26
36
27
-
```bash
28
-
docker run -d -p 30333:30333 -p 9933:9933 -v /my/local/folder:/polkadot parity/polkadot:latest --chain westend --rpc-external --rpc-cors all
29
-
```
37
+
Set user id 1000 and group id 1000, by running `chown 1000.1000 /my/local/folder -R` if you use a bind mount.
30
38
31
-
Additionally if you want to have custom node name you can add the `--name "YourName"` at the end
39
+
To start a Polkadot node on default rpc port 9933 and default p2p port 30333 use the following command. If you want to connect to rpc port 9933, then must add Polkadot startup parameter: `--rpc-external`.
32
40
33
41
```bash
34
-
docker run -d -p 30333:30333 -p 9933:9933 -v /my/local/folder:/polkadot parity/polkadot:latest --chain westend --rpc-external --rpc-cors all --name "PolkaDocker"
42
+
$ENGINE run -d -p 30333:30333 -p 9933:9933 \
43
+
-v /my/local/folder:/polkadot \
44
+
parity/polkadot:latest \
45
+
--chain westend --rpc-external --rpc-cors all \
46
+
--name "PolkaDocker
35
47
```
36
48
37
49
If you also want to expose the webservice port 9944 use the following command:
38
50
39
51
```bash
40
-
docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -v /my/local/folder:/polkadot parity/polkadot:latest --chain westend --ws-external --rpc-external --rpc-cors all --name "PolkaDocker"
52
+
$ENGINE run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 \
53
+
-v /my/local/folder:/polkadot \
54
+
parity/polkadot:latest \
55
+
--chain westend --ws-external --rpc-external --rpc-cors all --name "PolkaDocker"
41
56
```
42
57
43
58
## Using Docker compose
@@ -55,17 +70,19 @@ services:
55
70
- 30333:30333 # p2p port
56
71
- 9933:9933 # rpc port
57
72
- 9944:9944 # ws port
73
+
- 9615:9615 # Prometheus port
58
74
volumes:
59
75
- /my/local/folder:/polkadot
60
76
command: [
61
77
"--name", "PolkaDocker",
62
78
"--ws-external",
63
79
"--rpc-external",
80
+
"--prometheus-external",
64
81
"--rpc-cors", "all"
65
82
]
66
83
```
67
84
68
-
With following docker-compose.yml you can set up a node and use polkadot-js-apps as the front end on port 80. After starting the node use a browser and enter your Docker host IP in the URL field: _<http://[YOUR_DOCKER_HOST_IP>_
85
+
With following `docker-compose.yml` you can set up a node and use polkadot-js-apps as the front end on port 80. After starting the node use a browser and enter your Docker host IP in the URL field: _<http://[YOUR_DOCKER_HOST_IP]>_
69
86
70
87
```bash
71
88
version: '2'
@@ -78,10 +95,12 @@ services:
78
95
- 30333:30333 # p2p port
79
96
- 9933:9933 # rpc port
80
97
- 9944:9944 # ws port
98
+
- 9615:9615 # Prometheus port
81
99
command: [
82
100
"--name", "PolkaDocker",
83
101
"--ws-external",
84
102
"--rpc-external",
103
+
"--prometheus-external",
85
104
"--rpc-cors", "all"
86
105
]
87
106
@@ -100,36 +119,39 @@ Chain syncing will utilize all available memory and CPU power your server has to
100
119
101
120
If running on a low resource VPS, use `--memory` and `--cpus` to limit the resources used. E.g. To allow a maximum of 512MB memory and 50% of 1 CPU, use `--cpus=".5" --memory="512m"`. Read more about limiting a container's resources [here](https://docs.docker.com/config/containers/resource_constraints).
102
121
103
-
Start a shell session with the daemon:
104
122
105
-
```bash
106
-
docker exec -it $(docker ps -q) bash;
107
-
```
123
+
## Build your own image
108
124
109
-
Check the current version:
125
+
There are 3 options to build a polkadot container image:
126
+
- using the builder image
127
+
- using the injected "Debian" image
128
+
- using the generic injected image
110
129
111
-
```bash
112
-
polkadot --version
113
-
```
130
+
### Builder image
114
131
115
-
## Build your own image
132
+
To get up and running with the smallest footprint on your system, you may use an existing Polkadot Container image.
116
133
117
-
To get up and running with the smallest footprint on your system, you may use the Polkadot Docker image.
118
-
You can build it yourself (it takes a while...) in the shell session of the daemon:
134
+
You may also build a polkadot container image yourself (it takes a while...) using the container specs `scripts/ci/dockerfiles/polkadot/polkadot_builder.Dockerfile`.
119
135
120
-
```bash
121
-
cd scripts/ci/dockerfiles/polkadot
122
-
./build.sh
123
-
```
136
+
### Debian injected
137
+
138
+
The Debian injected image is how the official polkadot container image is produced. It relies on the Debian package that is published upon each release. The Debian injected image is usually available a few minutes after a new release is published.
139
+
It has the benefit of relying on the GPG signatures embedded in the Debian package.
140
+
141
+
### Generic injected
142
+
143
+
For simple testing purposes, the easiest option for polkadot and also random binaries, is to use the `binary_injected.Dockerfile` container spec. This option is less secure since the injected binary is not checked at all but it has the benefit to be simple. This option requires to already have a valid `polkadot` binary, compiled for Linux.
144
+
145
+
This binary is then simply copied inside the `parity/base-bin` image.
124
146
125
147
## Reporting issues
126
148
127
149
If you run into issues with Polkadot when using docker, please run the following command
128
150
(replace the tag with the appropriate one if you do not use latest):
129
151
130
152
```bash
131
-
docker run --rm -it parity/polkadot:latest --version
153
+
$ENGINE run --rm -it parity/polkadot:latest --version
132
154
```
133
155
134
156
This will show you the Polkadot version as well as the git commit ref that was used to build your container.
135
-
Just paste that in the issue you create.
157
+
You can now paste the version information in a [new issue](https://github.com/paritytech/polkadot/issues/new/choose).
0 commit comments