runs a command inside of a new container, using a specific image.
Property | Description | Required |
---|---|---|
image |
Docker image to use | Yes |
build |
Options for building a docker image | No |
update |
Pull or build image before executing task | No |
pull |
Pull image before executing task | No |
auto_remove |
Remove container after task is finished | No |
environment |
Add environment variables | No |
volumes |
Volumes to mount into the container | No |
entrypoint |
Override the default entrypoint | No |
command |
Override the default image command | No |
user |
User to run the command as | No |
working_dir |
Working directory for the command | No |
Specify the image to start the container from. If you specify build, ckron uses this value as the name for the built image
image: redis
image: ubuntu:18.04
image: tutum/influxdb
image: example-registry.com:4000/postgresql
image: a4bc65f
Configuration options for building a docker image for use in the run task
build: ./dir
build:
context: ./dir
dockerfile: Dockerfile-alternate
args:
buildno: 1
Pull or build image before executing task. Default value is missing
update: always # Always update before executing task
update: never # Don't update image automatically
update: missing # Pull or build image if not found locally
Deprecated: use update instead Pull image before executing task. Default value is missing
pull: always # Always pull before executing task
pull: never # Don't pull image automatically
pull: missing # Pull image if not found locally
Remove container after task is finished. Default value is true
auto_remove: false
Add environment variables. You can use either an array or a dictionary. Any boolean values (true, false, yes, no) need to be enclosed in quotes to ensure they are not converted to True or False by the YML parser.
environment:
RACK_ENV: development
SHOW: 'true'
SESSION_SECRET:
environment:
- RACK_ENV=development
- SHOW=true
- SESSION_SECRET
Bind mount host machine directory into the container. It uses SOURCE:TARGET[:MODE]
format, where SOURCE is a host path and TARGET is the container path where the directory is mounted. Standard modes are ro for read-only and rw for read-write (default).
volumes:
- /opt/data:/var/lib/mysql
- /etc/config:/etc/config:ro
Override the default entrypoint. The entrypoint can also be a list
entrypoint: /code/entrypoint.sh
entrypoint: ["php", "-d", "memory_limit=-1", "vendor/bin/phpunit"]
Override the default image command. The command can also be a list
command: touch /tmp/example
command: ["touch", "/tmp/example"]
User to run the command as.
user: nobody
Working directory for the command.
working_dir: /tmp
Runs a new command in a running container
Property | Description | Required |
---|---|---|
container |
Container name or container id | Yes |
command |
Command to execute inside the container | Yes |
environment |
Add environment variables | No |
working_dir |
Working directory for the command | No |
user |
User to execute as | No |
Container name or container id of the container were the command should be executed.
container: my_container
container: c9b92d9a79d3
Add environment variables. You can use either an array or a dictionary. Any boolean values (true, false, yes, no) need to be enclosed in quotes to ensure they are not converted to True or False by the YML parser.
environment:
RACK_ENV: development
SHOW: 'true'
SESSION_SECRET:
environment:
- RACK_ENV=development
- SHOW=true
- SESSION_SECRET
Command to execute inside the container. The command can also be a list
command: touch /tmp/example
command: ["touch", "/tmp/example"]
User to execute as.
user: nobody
Send a signal to the main process inside the container. Similar to docker kill --signal
Property | Description | Required |
---|---|---|
container |
Container name or container id | Yes |
signal |
Signal to send to the process | Yes |
Container name or container id of the container were the signal will be sent.
container: my_container
container: c9b92d9a79d3
Signal to send to the process.
signal: SIGHUP
Working directory for the command.
working_dir: /tmp