Docker Image
Run an existing Docker Image as a task on Airplane
The Docker Image task type is the most powerful type, as you can build and run any custom image on Airplane. This is useful if you're already building an image, or if you have a custom build process for your Docker images, and you want to use that image for your Airplane task.
If you'd like a custom Docker image but want Airplane to manage the build step, we recommend using Shell tasks, which allow specifying your own Dockerfile.

Getting Started

To create a new Docker Image task, select Docker from the New Task page:
Specify the image to use and the command to run:
If necessary, you can also set an entrypoint. If left unset, Airplane will use the default entrypoint of the image (if any).
You can add parameters and interpolate them into your command via the slug displayed next to the parameter name:

JSON Interpolation

Airplane supports a special variable {{JSON}} to easily serialize parameters and pass them into your image. We recommend doing this if you have control over the command being run:
1
// my_command receives a JSON string:
2
{"name": "John", "email": "j[email protected]"}
Copied!

Private Images on Airplane-Hosted Agents

If you're using Airplane-hosted agents (the default), you can access private images by attaching an environment variable named DOCKER_PULL_SECRETS. This variable should be a string in the Docker credentials format: a base64-encoded JSON string with username and password fields.
For example, if your username/password is MY_USERNAME / SECRET_PASSWORD:
1
{"username": "MY_USERNAME", "password": "SECRET_PASSWORD"}
Copied!
The base64-encoded string (which you should use as the config value) is:
1
# On MacOS, you can run
2
# echo '{"username": "MY_USERNAME", "password": "SECRET_PASSWORD"}' | base64
3
eyJ1c2VybmFtZSI6ICJNWV9VU0VSTkFNRSIsICJwYXNzd29yZCI6ICJTRUNSRVRfUEFTU1dPUkQifQo=
Copied!
Airplane-hosted agents do not yet support other forms of registry authentication. For GCP and AWS integration, see self-hosted agents below.

Private Images on Self-Hosted Agents

Self-hosted agents run in a customer's environment and can utilize native features of GCP and AWS to access private registries hosted on Google GCR and Amazon ECR, respectively.
On GCP, ensure that the instance running the agent has the necessary GCP permissions to access the GCR repository. The agent will automatically use the instance's IAM permissions to acquire Docker credentials when pulling from *.gcr.io registries.
On AWS, ensure that the instance running the agent has the necessary IAM permissions to pull from Amazon ECR. The agent will automatically use the instance's IAM permissions to acquire Docker credentials when pulling from *.amazonaws.com registries.
Last modified 1mo ago