Creating a Custom Parity Docker Image

Creating a custom Parity Ethereum Client Docker image is done by writing a dockerfile script. To keep things a simple as possible, I’ll be basing this article on my previous one, Running a Parity Docker Container with Custom Configuration.
TL;DR
A GitHub repository with the complete example is available here:
As in the previous article, we’ll have two directories:
src
: will contain the configuration fileseng
: will contain the dockerfile and a docker compose file for testing
I won’t go over generating a wallet, the chain.json
and config.toml
as they were already discussed in the previous article mentioned above.
The Dockerfile
We’ll start by creating a parity.dockerfile
in our eng
directory, and base our custom image on the official parity/parity
image, so the file will start with:
Next we’ll copy the two configuration files:
Note: The paths used in the copy commands assume the docker build context will be set to the root directory
Lastly, we’ll updated the container execution command to use the configuration file we copied in the previous step:
The complete file should look like this:
Testing The Build Script
Here you have two options, either use the updated docker-compose.yml
file, which now uses the dockerfile instead of the parity/parity
image:
Or, use docker build
to build the file:
In a “real world” scenario, we would have pushed out custom image to a repository, so it could be used by other team members or other people in general.