We love the little whale. It allows us to build products on a single platform using micro-services architecture, and deploy across a wide variety of environments. It’s light, fast and liberates developers from the drudgery of having to maintain support for multiple operating systems

EOS, an amazing blockchain solution, thankfully has the good sense to maintain an image of its product on the Docker Hub, which means that whether on OSX, Linux or (gulp!) the Windows platforms, we are spared from having to install source and tools, and having to compile and run services by hand — rather we issue a single command and the latest and freshest version runs in our environment, ready to go

To get there is a little more complicated than the various articles and documentation out there lead us to believe. In this article I will attempt to lay out a clean and simple procedure for getting up and running quickly

Docker Compose

The Docker environment comes with an orchestrator that allows us to abstract a great many details about how to run containers¹

EOS provides a docker-compose.yml on their github repository, which is great but isn’t specifically for developers i.e. tools like eosiocpp aren’t included in the image. Fortunately, they do have an image called eosio/eos-dev for developers and we modify the current yml to use this correct image — I provide my fixed-up version on github, which I recommend you place in a directory called eos (you can call it whatever you like):

OSX/Linux

mkdir eos; cd eos

curl -L http://bit.ly/2JEHAQk > docker-compose.yml

Windows (Powershell ≥ 3.0)

mkdir eos

cd eos

Invoke-WebRequest -OutFile docker-compose.yml http://bit.ly/2JEHAQk

The docker-compose file uses named volumes and, for whatever reason, they are declared as external. This is a nuisance since it requires us to manage them i.e. create them before we run the orchestrator, delete them when no longer needed, make sure they’re clean in between runs at times. I prefer bound directories, so the yml has been thus modified

Also, to be able to compile our contracts (residing on the local file system), we need to mount a directory. The docker-compose file has also been modified to use a directory called contracts relative to our current directory, therefore, create it like this:

mkdir contracts

We’re now ready to run the environment. We can do that with one simple command:

docker-compose up -d

If this is your first time, it may take a little while as the images get downloaded and loaded, and the containers built. The output will likely look similar to that shown below:

Creating volume "eos_nodeos-data-volume" with default driver

Creating volume "eos_keosd-data-volume" with default driver

Pulling nodeosd (eosio/eos-dev:)...

latest: Pulling from eosio/eos-dev

6b98dfc16071: Already exists

4001a1209541: Already exists

6319fc68c576: Already exists

b24603670dc3: Already exists

97f170c87c6f: Already exists

989c07c6edff: Already exists

3cb5f57fd105: Already exists

17e8c5aa3340: Already exists

865a94241630: Already exists

78c0dba4c581: Already exists

80dfca640586: Already exists

e56cf35e4a67: Already exists

36519f785e03: Already exists

07695dae958b: Already exists

d61d51134ed0: Already exists

0968c979e0d8: Already exists

cecf24f79303: Pull complete

03348f5b07b3: Pull complete

1fea77e318cf: Pull complete

e0a8fecc5f9f: Pull complete

Digest: sha256:8f1841f71332109d8281cbd4197751933f2bf4fb5e77db189908bb77782b19df Status: Downloaded newer image for eosio/eos-dev:latest Creating eos_nodeosd_1 ... done

Creating eos_keosd_1 ... done

The second time will be super-fast and will probably look like this: