Skip to main content

Working with Docker

Humans.ai may be used in a variety of ways with Docker. Check out the instructions for creating a Docker image containing the Humans.ai binary if you wish to run Humans.ai inside a Docker setup and maybe connect the Docker container to other containerized compatible blockchain binaries. Go to the section on creating the Humans.ai binary with Docker if, on the other hand, you wish to create a binary for usage outside of Docker but want to ensure the necessary dependencies are used.

note

The guidelines provided have been tested on Ubuntu 18.04.2 LTS with Docker 20.10.2 and macOS 13.2.1 with Docker 20.10.22.

Prerequisites

General Setup

Building Humans.ai binaries with Docker requires you to

  • Clone the Humans.ai repository to your computer (using git clone git@github.com/humansdotai/humans.git);
  • Check out the commit, branch, or release tag you wish to build (e.g. git checkout v1.0.0).

Building A Docker Image Containing The Binary

Step into the cloned repository and issue the following command in a terminal window to create a Docker image that contains the Humans.ai binary:

make build-docker

This will create an image with the name humansdotai/humans and the version tag latest. Now it is possible to run the humansd binary in the container, e.g. evaluating its version:

docker run -it --rm humansdotai/humans:latest humnasd version

Building The Binary With Docker

The humansd binary can be built deterministically with Docker. The container system offered by Docker allows for the creation of a Humans.ai binary instance in a private environment.

Building the Image

Run the following command to launch a build for all supported architectures (currently linux/amd64):

make distclean build-reproducible

The build system creates binaries and a deterministic build report, which are both stored in the directory called artifacts. You may validate the build's soundness by looking at the list of build artifacts and their corresponding checksums in the artifacts/build_report file.

Builder Image

A deterministic build environment is provided via the Tendermint builder Docker image, which is used to create Cosmos SDK apps. It offers a method for ensuring that the executables were indeed created from the git source code. Additionally, it ensures that the executable uses the same, thoroughly tested dependencies.


In the section on setting up a local network that follows, you'll find instructions for running a node instance once you've created the Humans.ai binary, either for local usage or in a Docker container.