Skip to content
On this page
Reference → Airnode → v0.11 → Docker Images
SearchHighlight.vue
FLEX_START_TAG

Client Image

Usually the Airnode is deployed on a serverless platform using the deployer. However, there is another option which is to run the Airnode in a docker container on your machine locally, on premise or cloud hosted.

A docker client image has been published on Docker Hub. If you want to build the container from the source yourself, you can find the image and built instructions in the Airnode repository.

Configuration

The Airnode needs two configuration files for its run: config.json and secrets.env. These files need to be passed to the Docker container via volumes.

The Docker container looks for configuration files mounted internally in the /app/config directory.

Your current working directory should contain the configuration files above and you bind it to the /app/config directory for the docker using the --volume parameter.

sh
$ tree
.
├── config.json
└── secrets.env
$ docker run --volume $(pwd):/app/config ...
powershell
$ tree
.
├── config.json
└── secrets.env
$ docker run --volume $(pwd):/app/config ...
batch
$ tree
.
├── config.json
└── secrets.env
$ docker run --volume %cd%:/config:/app/config ...

Usage

Example directory structure and commands for running the Airnode Docker container. The below commands are run from the depicted directory.

Running Airnode

Use the following command to run Airnode:

sh
docker run \
  --volume $(pwd):/app/config \
  --name airnode \
  api3/airnode-client:0.11.1
powershell
docker run  \
  --volume $(pwd):/app/config \
  --name airnode \
  api3/airnode-client:0.11.1
batch
docker run  ^
  --volume %cd%:/app/config ^
  --name airnode ^
  api3/airnode-client:0.11.1

If you want to connect Airnode to a blockchain running on localhost, you need to make the blockchain accessible from within the docker itself. If you use docker for linux you can use --network="host" parameter. If you are using Docker Desktop (on any platform), connect to http://host.docker.internal:8545 instead of http://127.0.0.1:8545. See https://stackoverflow.com/a/24326540.

Checking Airnode logs

Logs will be output to the console after running the above command. If you decide to run Airnode in detached mode with --detach, you need to use the logs command, optionally with --follow, to access the logs.

bash
docker logs airnode

or

bash
docker logs --follow airnode

Stopping Airnode

bash
docker stop airnode
FLEX_END_TAG

Released under the MIT License.