Job Type: Docker Image

March 2, 2020 ยท View on GitHub

You can also specify an already build image and run it as a job.

{
    "version": 1,
    "jobs": [{
        "type": "docker-image",
        "name": "test",
        "image": "alpine:latest",
        "command": ["echo", "hello world"]
        "resources": { "limits": { "cpu": 1, "memory": 1024 } },
        "build_context": "...",
        "cache": { ... },
        "timeout": 3600,
        "depends_on": ["other_job_name"],
        "deployments": [ ... ],
        "environment": { ... },
        "security_context": { ... },
        "repository": { ... },
        "registries": [],
        "run": true
    }]
}
NameRequiredTypeDefaultDescription
typetruestringHas to be "docker-image" to run a single Docker container
nametruestringName of the job
imagetruestringImage to use, i.e. alpine:latest
commandfalsestringThe command in exec form
resourcestrueResource ConfigurationSpecify the required resources for your job
build_contextfalsestringSpecify the docker build context. If not set the directory containing the infrabox.json file will be used.
cachefalseCache Configuration{}Configure the caching behavior
timeoutfalseinteger3600Timeout in seconds after which the job should be killed. Timeout starts when the job is set to running
depends_onfalseDependency Configuration[]Jobs may have dependencies. You can list all jobs which should finish before the current job may be executed.
environmentfalseEnvironment Variables{}Can be used to set environment variables for the job.
deploymentsfalseDeployment Configuration[]Push your images to a registry
security_contextfalseSecurity Context[]Configure security related options
repositoryfalseRepository Configuration{}Configure git repository options
registriesfalseSource Registry Configuration[]Configure the source registries
runfalsebooleantrueSet to false if you have a deployment configured and only want to push an image but not execute it