The Kaniko ECR plugin can be used to build and publish images to the Amazon ECR registry, using the Kaniko image builder. Unlike the Docker ECR plugin, you are not required you to run your agent in privileged mode.
Example
kind: pipeline
name: default
steps:
- name: kaniko
image: plugins/kaniko-ecr
settings:
access_key: a50d28f4dd477bc184fbd10b376de753
secret_key: bc5785d3ece6a9cdefa42eb99b58986f9095ff1c
region: us-east-1
repo: bar
registry: <account_id>.dkr.ecr.us-east-1.amazonaws.com
Properties
access_key
stringrequiredAWS access key.
Secret recommendedDefault: none
secret_key
stringrequiredAWS secret key.
Secret recommendedDefault: none
create_repository
booleanoptionalCreate repository if it does not exist.
Default: false
region
stringoptionalAWS region.
Default: us-east-1
registry
stringrequiredauthenticates to this registry
Default: none
repo
stringrequiredrepository name for the image
Default: none
lifecycle_policy
stringoptionalfilename of ecr lifecycle json policy.
Default: none
repository_policy
stringoptionalfilename of ecr repository json policy.
Default: none
tags
arrayoptionalrepository tags to apply to the image
Default: none
dockerfile
stringoptionalpath to the Dockerfile
Default: Dockerfile
context
stringoptionalpath to the context directory
Default: git repo root
target
stringoptionalthe build target to use, must be defined in the docker file
Default: none
build_args
arrayoptionalcustom arguments passed to docker build.
Default: none