Docker images come real handy when you don’t need to keep an environment running. You can just pull the docker image and have the environment ready for use. This is specially useful in continuous integration. Doesn’t matter if you use Travis, CircleCI or anything else, you can always reliably use a docker image and get an already set up reliable environment.
I was looking for a docker environment for CircleCI that had node.js and native solc binary pre-installed but I couldn’t find any. Fortunately, creating docker images by using
The image is based on Ubuntu Bionic and comes with the following tools pre installed for ease of use:
- Node 8
- solc (native binary)
- Truffle 5
Truffle 5 supports using native solc for compiling smart contracts instead of solc.js. Native solc is way faster than solc.js but is less portable. This is where docker comes in handy. Using docker images, you can have the speed of native solc and portability of solc.js.
You can use this docker image by directly pulling it from docker hub using the below command:
docker pull maxsam4/solidity-kit
The default tag is
latest and it contains solidity 0.5. If you want solidity 0.4.24 then pull the tag
docker pull maxsam4/solidity-kit:0.4.24
You may configure CircleCI to use this docker image as base container by supplying the image name in your config file:
- image: maxsam4/solidity-kit
Other CI tools can also be configured similarly. Please refer to their documentation for more information. This docker image is nothing special in its own but it will definitely come handy when you might need it.