The job type docker is one of the most important jobs. You can use it to run any Docker container you like.
{
"version": 1,
"jobs": [{
"type": "docker",
"name": "build",
"docker_file": "infrabox/build-and-test/Dockerfile",
"command": ["echo", "hello world"]
"resources": { "limits": { "cpu": 1, "memory": 1024 } },
"build_only": false,
"build_context": "...",
"cache": { ... },
"timeout": 3600,
"depends_on": ["other_job_name"],
"environment": { ... },
"build_arguments": { ... },
"deployments": [ ... ],
"security_context": { ... },
"repository": { ... },
"registries": []
}]
}| Name | Required | Type | Default | Description |
|---|---|---|---|---|
| type | true | string | Has to be "docker" to run a single Docker container | |
| name | true | string | Name of the job | |
| docker_file | true | string | Path to the Dockerfile |
|
| command | false | string | The command in exec form to be used when the container is run. Ignored if build_only=false |
|
| resources | true | Resource Configuration | Specify the required resources for your job. | |
| build_only | true | boolean | true | If set to true the container will only be build but not run. Use it if you only want to build a container and push it to a registry. See here for how to push to a docker registry. |
| build_context | false | string | Specify the docker build context. If not set the directory containing the infrabox.json file will be used. |
|
| cache | false | Cache Configuration | {} | Configure the caching behavior |
| timeout | false | integer | 3600 | Timeout in seconds after which the job should be killed. Timeout starts when the job is set to running |
| depends_on | false | Dependency Configuration | [] | Jobs may have dependencies. You can list all jobs which should finish before the current job may be executed. |
| environment | false | Environment Variables | {} | Can be used to set environment variables for the job. |
| build_arguments | false | Build Arguments | {} | Can be used to set docker build arguments. |
| deployments | false | Deployment Configuration | [] | Push your images to a registry. |
| security_context | false | Security Context | [] | Configure security related options, |
| repository | false | Repository Configuration | {} | Configure git repository options. |
| registries | false | Source Registry Configuration | [] | Configure the source registries. |
To set docker build arguments create an object with the names and values for build_arguments.
{
"version": 1,
"jobs": [{
"type": "docker",
...
"build_arguments": {
"ARG_1": "My value",
"ANOTHER_ARG": "some other value
}
}]
}Build arguments are only supported for docker job types.
{
"version": 1,
"jobs": [{
...
"security_context": {
"privileged": false
}
}]
}| Name | Required | Type | Default | Description |
|---|---|---|---|---|
| privileged | false | boolean | false | If set to true the container will be run in privileged mode |