Image Source Registry

October 28, 2018 ยท View on GitHub

If your images have to be pulled from a private registry you may configure the credentials for each job.

Docker Registry

{
    "type": "docker",
    ...
    "registries": [{
        "type": "docker-registry",
        "host": "<my_registry>:5000",
        "repository": "repo-name",
        "username": "your_username",
        "password": { "$secret": "SECRET_NAME_FOR_YOUR_PASSWORD" }
    }]
}
NameRequiredTypeDefaultDescription
typetruestringHas to be "docker-registry"
hosttruestringHost of the registry. I.e. my-registry.com:5000
repositorytruestringName of the repository
usernamefalsestringUsername to be used with the registry
passwordfalseSecretSecret containing the password

ECR

{
    "type": "docker",
    ...
    "registries": [{
        "type": "ecr",
        "host": "<my_registry>",
        "repository": "repo-name",
        "region": "region",
        "access_key_id": { "$secret": "SECRET_KEY_ID" },
        "secret_access_key": { "$secret": "SECRET_ACCESS_KEY" }
    }]
}
NameRequiredTypeDefaultDescription
typetruestringHas to be "ecr"
hosttruestringECR endpoint
repositorytruestringName of the repository
regiontruestringAWS Region
access_key_idtrueSecretSecret containing the AWS Access Key ID
secret_access_keytrueSecretSecret containing AWS Secret Access Key

GCR

{
    "type": "docker",
    ...
    "registries": [{
        "type": "gcr",
        "host": "eu.gcr.io",
        "repository": "<project-id>/<repo-name>",
        "service_account": { "$secret": "GCP_SERVICE_ACCOUNT" },
    }]
}
NameRequiredTypeDefaultDescription
typetruestringHas to be "gcr"
hosttruestringGCR endpoint i.e. us.gcr.io
repositorytruestringName of the repository
service_accounttrueSecretSecret containing the GCP Service Account with role Storage Admin