aws / aws/aws-cdk

[aws-ecr-assets] DockerImageAsset: Suppress docker build output

Open
#29,555 3 comments 5 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 am using `ecr_assets.DockerImageAsset` to build a docker image from a Dockerfile. I would like a way to suppress the output of this. The output from docker interferes with the normal out of CDK, below example of how it looks. Ugly and more importantly confusing.
![image](https://github.com/aws/aws-cdk/assets/39311195/1ccc2d06-434f-4288-9103-3d1e58501c43)

It would be nice, if either one could disable it, our somehow guarantee that they don't interfere, build the image and then once done and all the logs are out, start with the cdk output.

### Use Case

I just think it would be better if one could suppress the output and just have the regular CDK output. It's going to be easier when debugging, and if I need to debug the build image process I could temporarily remove the flag.

### Proposed Solution

`docker build` has a flag that suppresses outputs, `-q --quite`. A solution similar to how `cache_disabled` is implemented.
An optional `boolean` parameter that adds `-q` flag to the `docker build` command.

### Other Information

_No response_

### Acknowledgements

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

### CDK version used

2.130.0

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

Windows 11

Contributor guide

Open the contributing guide

Research direction

Start with ecr_assets.DockerImageAsset and the existing cache_disabled option, then trace the docker build command it assembles. Add the optional quiet behavior described for docker build and verify that normal CDK output remains readable while the build output is suppressed.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.