The following section documents the steps to build and deploy the Algod Docker Image.
Verify that you have a running Docker Engine on your local system. Instructions for installing Docker are available on the Docker web site:
https://docs.docker.com/
The docker release image is automatically created as part of the release building process initiated by the scripts/build_release.sh script.
It is possible to manually build the docker image with the following procedure:
Download the node_linux-amd64.tar.gz file from S3
First, check to see what version is available.
aws s3 ls algorand-releases/channel/stable/
2019-07-07 13:07:52 0
2019-07-09 16:01:22 115465587 node_stable_darwin-amd64_1.0.27.tar.gz
2019-07-09 16:01:58 104119607 node_stable_linux-amd64_1.0.27.tar.gz
Set the environment variable 'FULLVERSION' to the version of the latest release, in this case, 1.0.27. Also, set the environment variable "CHANNEL", in this case, "stable".
For example:
export FULLVERSION="1.0.29"
export CHANNEL="stable"
Then download the Linux amd64 image.
aws s3 cp s3://algorand-releases/channel/${CHANNEL}/node_${CHANNEL}_linux-amd64_${FULLVERSION}.tar.gz ~/temp/
Change directory to the go-algorand/docker/release directory:
cd ${GOPATH}/src/github.com/algorand/go-algorand/docker/release/
Run the build_algod_docker.sh script to build the docker image:
./build_algod_docker.sh ~/temp/node_${CHANNEL}_linux-amd64_${FULLVERSION}.tar.gz
A resulting docker tar file will be generated and placed here:
~/node_pkg/algod_docker_package_${CHANNEL}_${FULLVERSION}.tar.gz
To use the resulting docker image:
Change directory to the ~/node_pkg directory.
cd ~/node_pkg
If you prefer using a prebuilt docker package, download one from the S3 releases directory:
aws s3 ls algorand-releases/channel/${CHANNEL}/algod_docker_package_${CHANNEL}_${FULLVERSION}.tar.gz
tar xvf algod_docker_package_${CHANNEL}_${FULLVERSION}.tar.gz
Change directory to the algorand_pkg_1.0.27 subdirectory
cd algod_pkg_${CHANNEL}_${FULLVERSION}
Import the Docker image into the Docker environment
docker import algod_docker_export_${CHANNEL}_${FULLVERSION}.tar.gz
Run the script to launch the Docker container specifying the network to attach to, one of (betanet, devnet, testnet, or mainnet). The network specifies which Algorand genesis file the container will use and the network it will connect to. If no network is specified, the default network is 'testnet'.
export NETWORK="testnet"
./start_algod_docker.sh ${NETWORK}
Optionally attach to the running container.
docker exec -it algod_${CHANNEL}_${FULLVERSION}_${NETWORK} /bin/bash
While attached, verify the status of the Algod instance.
goal node status
Run the following command to stop the docker container:
docker stop algod_${CHANNEL}_${FULLVERSION}_${NETWORK}
To remove the container from the Docker environment:
docker container rm algod_${CHANNEL}_${FULLVERSION}_${NETWORK}
When starting the Algod Docker instance, a Docker volume is created to persist the node data directory external from the container. This allows updating the docker container and reusing an existing data directory with the new version. A volume is created for each instantiated network (i.e. betanet, devnet, testnet, or mainnet).
The existing volumes can be determined using the docker volume command.
docker volume ls
To remove a volume:
docker volume rm alogd-${NETWORK}