aws / aws/aws-cdk

aws-ecr-assets: skip docker build with parameter

Open
#25,807 4 comments 16 reactions 0 assignees View on GitHub
@aws-cdk/aws-ecr-assets effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

I want to be able to skip the docker build with a parameter. Something like this:
```
import { DockerImageAsset } from "aws-cdk-lib/aws-ecr-assets";

...

new DockerImageAsset(scope, "AppDockerImage", {
directory: path.join(__dirname, "../"),
skipBuild: process.env.SKIP_BUILD,
});
```

### Use Case

Sometimes I just changed something in the infrastructure and want to test the changes without needing to rebuild the docker image since it may take very long. For that, I would like to have a flag in the pipeline that sets an environment variable. That variable can be used to skip the docker build.

### Proposed Solution

See feature description

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.79.1

### Environment details (OS name and version, etc.)

macOS

Contributor guide

Open the contributing guide

Research direction

Start at the DockerImageAsset entry point in aws-ecr-assets and trace how the current Docker build is triggered. Define the parameter's behavior for the infrastructure-only workflow, including what happens when the build is skipped, and verify that the requested pipeline use case works without rebuilding the image.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.