Skip to main content

CDK construct library that allows you to build docker images with kaniko in AWS Fargate

Project description

NPM version PyPI version Release

cdk-kaniko

Build images with kaniko in AWS Fargate

About

cdk-kaniko is a CDK construct library that allows you to build images with kaniko in AWS Fargate. Inspired from the blog post - Building container images on Amazon ECS on AWS Fargate by Re Alvarez-Parmar and Olly Pomeroy, this library aims to abstract away all the infrastructure provisioning and configuration with minimal IAM policies required and allow you to focus on the high level CDK constructs. Under the covers, cdk-kaniko leverages the cdk-fargate-run-task so you can build the image just once or schedule the building periodically.

Install

Use the npm dist tag to opt in CDKv1 or CDKv2:

// for CDKv2
npm install cdk-kaniko
or
npm install cdk-kaniko@latest

// for CDKv1
npm install cdk-kaniko@cdkv1

Sample

# Example automatically generated from non-compiling source. May contain errors.
const app = new cdk.App();

const stack = new cdk.Stack(app, 'my-stack-dev');

const kaniko = new Kaniko(stack, 'KanikoDemo', {
  context: 'git://github.com/pahud/vscode.git',
  contextSubPath: './.devcontainer',
});

// build it once
kaniko.buildImage('once');

// schedule the build every day 0:00AM
kaniko.buildImage('everyday', Schedule.cron({
  minute: '0',
  hour: '0',
}));

fargate spot support

Use fargateSpot to enable the FARGATE_SPOT capacity provider to provision the fargate tasks.

# Example automatically generated from non-compiling source. May contain errors.
new Kaniko(stack, 'KanikoDemo', {
  context,
  contextSubPath,
  fargateSpot: true,
});

Note

Please note the image building could take some minutes depending on the complexity of the provided Dockerfile. On deployment completed, you can check and tail the AWS Fargate task logs from the AWS CloudWatch Logs to view all the build output.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk-kaniko-2.0.7.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_kaniko-2.0.7-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file cdk-kaniko-2.0.7.tar.gz.

File metadata

  • Download URL: cdk-kaniko-2.0.7.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for cdk-kaniko-2.0.7.tar.gz
Algorithm Hash digest
SHA256 24d0b091ede32898f35bf7a966eae0e4fa4f44619ae7a58b0260075e188d690c
MD5 9d236b81264691267ebfd3ee8fced2e1
BLAKE2b-256 22c1d9e7410271732f5a4dd84a39e17258641b55291429f50957d4af20de8913

See more details on using hashes here.

File details

Details for the file cdk_kaniko-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: cdk_kaniko-2.0.7-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for cdk_kaniko-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2bed0a24c2f1aa52a41edefc675ea1a5cf2cce87462b69a74730d792e477a360
MD5 8ee984ef75855f4d2a8ea7cb42191484
BLAKE2b-256 8cbb94fdb0896aba0992da787b6ea86f62184053bbff08d17e40660d99bd586d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page