aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.48k stars 3.83k forks source link

cdk-assets: private ecr registry support overwrite any additional docker configuration #30743

Open gyalai-aws opened 2 months ago

gyalai-aws commented 2 months ago

Describe the bug

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

khushail commented 1 month ago

Thanks @gyalai-aws for reporting this and submission of PR.