Docker

These docs are deprecated. For the latest documentation, see Docker image tasks.
Airplane supports building a task from a Dockerfile. This is useful if you're already familiar with building Docker images and/or you want to fully customize your runtime environment.

Getting started

To create a new Docker-based task, run airplane init choosing "Create from scratch" and "Dockerfile":
Copied
1
$ airplane init
2
3
? How do you want to get started?
4
> Create from scratch
5
? Pick a runtime:
6
> Dockerfile
7
? Pick a name:
8
> Hello World
9
10
Once you are ready, deploy it to Airplane with:
11
airplane deploy -f airplane.yml
This will create a barebones Docker task for you, with a task definition (airplane.yml) and Dockerfile.
When airplane deploy is run, Airplane will build the Docker task for you:
  • Airplane runs docker build using the supplied Dockerfile.
  • The entrypoint will be invoked with (the equivalent of) docker run [image] -- [arguments...].

Example: Redis CLI

This sets up a basic task that can run a redis command (e.g. set) using the Redis Docker image:
yaml
Copied
1
# airplane.yml
2
3
slug: redis
4
name: Redis
5
builder: docker
6
builderConfig:
7
dockerfile: Dockerfile
8
arguments: ["set", "{{params.key}}", "{{params.value}}"]
9
parameters:
10
- name: Key
11
slug: key
12
type: string
13
- name: Value
14
slug: value
15
type: string
dockerfile
Copied
1
FROM redis:6.2
2
3
ENTRYPOINT ["redis-cli"]

Builder config reference

The Docker builder supports the following options in the task definition:
  • dockerfile: path to the Dockerfile.
yaml
Copied
1
dockerfile:
2
dockerfile: "Dockerfile"