Skip to content

An Image construct which takes care of building & pushing docker images for cdk8s

License

Notifications You must be signed in to change notification settings

cdk8s-team/cdk8s-image

cdk8s-image

An Image construct which takes care of building & pushing docker images that can be used in CDK8s apps.

The following example will build the docker image from Dockerfile under the my-app directory, push it to a local registry and then define a Kubernetes deployment that deploys containers that run this image.

const image = new Image(this, 'image', {
  dir: `${__dirname}/my-app`,
  registry: 'localhost:5000'
});

new Deployment(this, 'deployment', {
  containers: [ new Container({ image: image.url }) ],
});

Contributions

All contributions are celebrated.

License

Licensed under Apache 2.0.