2 Answers
- Newest
- Most votes
- Most comments
0
Use aws-ecr-assets cdk module
import { DockerImageAsset } from '@aws-cdk/aws-ecr-assets';
const asset = new DockerImageAsset(this, 'MyBuildImage', {
directory: path.join(__dirname, 'my-image'),
buildArgs: {
HTTP_PROXY: 'http://10.20.30.2:1234',
},
invalidation: {
buildArgs: false,
},
});
The directory my-image must include a Dockerfile.
This will instruct the toolkit to build a Docker image from my-image, push it to an Amazon ECR repository and wire the name of the repository as CloudFormation parameters to your stack.
answered 2 years ago
Relevant content
- Accepted Answerasked 2 years ago
- asked 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago