Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(assets): support drop-in docker replacements #21836

Closed
1 of 2 tasks
misterjoshua opened this issue Aug 30, 2022 · 2 comments · Fixed by #21838
Closed
1 of 2 tasks

(assets): support drop-in docker replacements #21836

misterjoshua opened this issue Aug 30, 2022 · 2 comments · Fixed by #21838
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p1

Comments

@misterjoshua
Copy link
Contributor

misterjoshua commented Aug 30, 2022

Describe the feature

I'd like the ability to change the docker command used when building/publishing assets.

Use Case

I'd like to use Depot's Docker shim as a drop-in replacement for the docker command so I can take advantage of their faster docker builds.

Proposed Solution

We could obtain a user-specified override from an environment variable named CDK_DOCKER here:

await shell(['docker', ...configArgs, ...args], {

Environment variables would be nice because these are easy to add to the build/deploy environment without changing customers' apps. There's precedence for this in core with CDK_DOCKER, but that environment variable only applies to bundling and not to docker image asset builds/publishing.

const prog = process.env.CDK_DOCKER ?? 'docker';

Other Information

I've attempted to add this feature in #21838

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

N/A

Environment details (OS name and version, etc.)

Linux

@misterjoshua misterjoshua added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 30, 2022
@github-actions github-actions bot added the @aws-cdk/assets Related to the @aws-cdk/assets package label Aug 30, 2022
@misterjoshua misterjoshua changed the title (assets): support drop-in replacements for the docker command (assets): support drop-in docker replacements Aug 31, 2022
@peterwoodworth peterwoodworth added p1 effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 3, 2022
@peterwoodworth
Copy link
Contributor

Thanks for the pr @misterjoshua, someone from the team will try to take a look soon 🙂

@mergify mergify bot closed this as completed in #21838 Sep 23, 2022
mergify bot pushed a commit that referenced this issue Sep 23, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…CKER` (#21838)

This PR introduces the ability for users to change the command used for building and publishing Docker images to a drop-in replacement like the [Depot](https://depot.dev) Docker shim. To change the docker command, the user provides the alternative command via an environment variable named `CDK_DOCKER`.

There's already something similar in `core`'s asset bundling, but it applies only to bundling and not to building and publishing Docker image assets.

https://github.com/aws/aws-cdk/blob/3e55092fb70e0ec74ee7c4144d6e39a29d8757ae/packages/%40aws-cdk/core/lib/bundling.ts#L523

Fixes #21836 

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

Depends-On: #22194
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

homakk pushed a commit to homakk/aws-cdk that referenced this issue Dec 1, 2022
…CKER` (aws#21838)

This PR introduces the ability for users to change the command used for building and publishing Docker images to a drop-in replacement like the [Depot](https://depot.dev) Docker shim. To change the docker command, the user provides the alternative command via an environment variable named `CDK_DOCKER`.

There's already something similar in `core`'s asset bundling, but it applies only to bundling and not to building and publishing Docker image assets.

https://github.com/aws/aws-cdk/blob/3e55092fb70e0ec74ee7c4144d6e39a29d8757ae/packages/%40aws-cdk/core/lib/bundling.ts#L523

Fixes aws#21836 

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

Depends-On: aws#22194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants