Running Namada with Docker

Pre-requisites

In order to run any Docker images, you must first have Docker installed. You can find installation instructions for your machine here (opens in a new tab).

Downloading the docker image

The Namada Docker image can be found here (opens in a new tab).

Under the Tags tab, you can find the latest version of the Docker image. Click on the link for the correct version of Namada that you are trying to install. For example, if you are trying to install Namada v0.37.0, you would click on the link for v0.37.0.

To download the Docker image, run:

docker pull ghcr.io/anoma/namada:namada-v0.37.0

You can list any downloaded Docker image by running docker images. The tag will be the first column of the output.

~$ docker images
REPOSITORY                                    TAG              IMAGE ID       CREATED         SIZE
ghcr.io/anoma/namada                          namada-v0.37.0   b9729acaabab   5 days ago      211MB

In this case, the full name of the downloaded image is ghcr.io/anoma/namada:namada-v0.37.0.

Running the docker image

Once you have downloaded the Docker image, it will be useful to export some environment variables:

export CHAIN_ID=<chain-id>
export DOCKER_IMAGE=ghcr.io/anoma/namada:namada-v0.37.0

The following Docker run command will run the ledger node:

docker run -P -i -t $DOCKER_IMAGE <namada command>

Where <namada command> is any command you would run after namada in the terminal. For example, if you wanted to run namada client utils join-network --chain-id $CHAIN_ID, you would run:

docker run -P -i -t $DOCKER_IMAGE client utils join-network --chain-id $CHAIN_ID

Then in order to run any other ledger commands, one can run:

docker /bin/bash -c "/bin/bash","-c", "<namada command>"

Alternative method (building the docker image yourself)

Alternatively, you can build the docker image yourself!

Begin by exporting some environment variables:

export CHAIN_ID=<chain-id>
export BRANCH=<namada-version>

For example if you wanted to build the docker image for Namada v0.16.0 and chain-id public-testnet-69.0.b20a1337aa1, you would run:

export CHAIN_ID=public-testnet-69.0.b20a1337aa1
export BRANCH=v0.28.2 #The latest branch of Namada

Then you can build the docker image by running:

git clone https://github.com/anoma/namada-sdk-starter.git
cd namada-sdk-starter/docker/namada-with-chain/
docker build --build-arg BRANCH=$BRANCH --build-arg CHAIN_ID=$CHAIN_ID -t namada_testnet_image .

Which will save the image to your local docker images. You can find the tag of the downloaded docker image by running docker images. The tag will be the first column of the output.

Save this docker image as an environment variable

export DOCKER_IMAGE=<tag>

Then you can run the docker image by running:

docker run -P -i -t $DOCKER_IMAGE