Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-cdk/aws-ecr-assets

Package Overview
Dependencies
Maintainers
5
Versions
249
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/aws-ecr-assets

Docker image assets deployed to ECR

  • 1.130.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
50K
decreased by-57.51%
Maintainers
5
Weekly downloads
 
Created

What is @aws-cdk/aws-ecr-assets?

@aws-cdk/aws-ecr-assets is an AWS CDK library that allows you to build and publish Docker images to Amazon Elastic Container Registry (ECR) as part of your AWS Cloud Development Kit (CDK) applications. This package simplifies the process of managing Docker images within your CDK stacks.

What are @aws-cdk/aws-ecr-assets's main functionalities?

Building Docker Images

This feature allows you to build Docker images from a specified directory and include them in your CDK stack. The Docker image is built and uploaded to an ECR repository automatically.

const ecrAssets = require('@aws-cdk/aws-ecr-assets');
const cdk = require('@aws-cdk/core');

class MyStack extends cdk.Stack {
  constructor(scope, id, props) {
    super(scope, id, props);

    new ecrAssets.DockerImageAsset(this, 'MyDockerImage', {
      directory: path.join(__dirname, 'my-docker-image')
    });
  }
}

const app = new cdk.App();
new MyStack(app, 'MyStack');

Using Docker Images in ECS

This feature demonstrates how to use a Docker image built with @aws-cdk/aws-ecr-assets in an Amazon ECS task definition. The Docker image is referenced directly from the ECR repository.

const ecs = require('@aws-cdk/aws-ecs');
const ecrAssets = require('@aws-cdk/aws-ecr-assets');
const cdk = require('@aws-cdk/core');

class MyStack extends cdk.Stack {
  constructor(scope, id, props) {
    super(scope, id, props);

    const asset = new ecrAssets.DockerImageAsset(this, 'MyDockerImage', {
      directory: path.join(__dirname, 'my-docker-image')
    });

    new ecs.ContainerImage.fromDockerImageAsset(asset);
  }
}

const app = new cdk.App();
new MyStack(app, 'MyStack');

Other packages similar to @aws-cdk/aws-ecr-assets

Keywords

FAQs

Package last updated on 29 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc