[core] allow asset bundling on docker remote host / docker in docker
See original GitHub issueCore AssetStaging
is now exposing a bundling
option key allowing assets to be built before being uploaded through a docker image.
Unfortunately the docker command is now using volume mount flags to mount input and output folder, making it impossible to execute if docker is set to run on a remote host or in a docker-in-docker env.
Use Case
I encountered this problem trying to build a couple of lambdas (and a custom resource provider) written in typescript on a Gitlab CI instance with docker-in-docker or executing docker commands via docker-machine.
Proposed Solution
My proposal is to create two temporary volumes on target docker env, one for inputs and one for outputs.
Then the first volume can be filled running a busybox
image as helper and calling docker cp
to fill the volume.
Once the cp has finished the helper is stopped and the build command is invoked.
After that, if exit code is 0, another helper is started and the docker cp
is used to copy outputs back to the cdk env.
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:29 (9 by maintainers)
Top GitHub Comments
@AntonUspehov sure no problem!
@pkasravi yes!
I solved it by making
cdk.out
a mounted volume with the exact same path within the docker container as it is on the host.https://github.com/katrinabrock/aws-cdk-dind-py-lambda/blob/master/docker-compose.yml#L8
I’m not sure if this is possible with github actions.