cdk-assets: private ecr registry support overwrite any additional docker configuration
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
- We have a proxy configuration for docker in the ./docker/config.json file.
- We are using private ecr to fetch our images which configuration is placed into the ~/.cdk/cdk-docker-creds.json file
The cdk-assets creates a new docker config file but it is only placing the contents of the ~/.cdk/cdk-docker-creds.json file and only the `credHelpers` property, so it is not even possible to include the proxy settings.
### Expected Behavior
Both configuration should be respected.
### Current Behavior
Only credentials are kept.
### Reproduction Steps
see before.
### Possible Solution
Change this line: https://github.com/aws/aws-cdk/blob/1fcef6309e54d7ec1e179c22a47a235b38fa1673/packages/cdk-assets/lib/private/docker.ts#L168C81-L168C92
Options:
1. Write out the whole ~/.cdk/cdk-docker-creds.json file not just the credHelpers
2. Add support to include additional ~/.cdk/cdk-docker*.json files to plug in additional docker configurations
3. Check whenever a ~./docker/config.json file exists and merge both files.
### Additional Information/Context
_No response_
### CDK CLI Version
2.147.0
### Framework Version
_No response_
### Node.js Version
Any
### OS
Any
### Language
TypeScript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start with packages/cdk-assets/lib/private/docker.ts at the linked line and trace how the temporary Docker configuration is assembled from cdk-docker-creds.json. Reproduce the setup with proxy settings in ./docker/config.json, then verify that the resulting configuration preserves both proxy settings and ECR credential helpers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, typescript
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100