[CDK Pipelines] Asset bundling (running Docker during 'synth') doesn't work
See original GitHub issueI’m trying out new CDK Pipelines in developer preview. I have a question on how to bundle assets that are using docker container during the build process. Currently during “synth_action”, getting following error:
Reproduction Steps
pipelines.CdkPipeline(self,
"Pipeline",
pipeline_name="Test",
cloud_assembly_artifact=cloud_assembly_artifact,
source_action=codepipeline_actions.CodeCommitSourceAction(
action_name="CodeCommit_Source",
repository=code,
branch="cdkpipeline",
output=source_artifact),
synth_action=pipelines.SimpleSynthAction.standard_npm_synth()
source_artifact=source_artifact,
cloud_assembly_artifact=cloud_assembly_artifact,
build_command="npx cdk synth")
Error Log
stderr: docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
at AssetStaging.bundle (/tmp/jsii-kernel-O8ZKbG/node_modules/@aws-cdk/core/lib/asset-staging.js:121:19)
at new AssetStaging (/tmp/jsii-kernel-O8ZKbG/node_modules/@aws-cdk/core/lib/asset-staging.js:38:35)
at new Asset (/tmp/jsii-kernel-O8ZKbG/node_modules/@aws-cdk/aws-s3-assets/lib/asset.js:21:25)
Environment
- CDK CLI Version: 1.51.0
- Module Version: 1.51.0
- Node.js Version: v14.5.0
- OS: OSX Mojave
- Language (Version): Python (3.7.3)
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:27 (7 by maintainers)
Top Results From Across the Web
Building, bundling, and deploying applications with the AWS ...
Code.fromAsset() method tells the AWS CDK where to find the Golang executable. When we run cdk synth , it stages this Go executable...
Read more >Applied selection: 0 assets selected with no SelfMutation ...
I have defined 3 individual cdk pipelines in the same AWS account & region, I have been facing this error in the staging...
Read more >aws-cdk.pipelines - Python Package Health Analysis - Snyk
If you see this error during the Synth step, it means that CodeBuild is expecting to find a cdk.out directory in the root...
Read more >AWS CDK - Fullstack Polyglot with Asset Bundling
This is my third article that deals with asset bundling in AWS CDK. ... we might be building in an environment that doesn't...
Read more >CDK Pipelines - Go Packages
For example, it can be triggered by npx cdk synth if aws-cdk is not in your package.json . Work around this by either...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We worked it out. We ended up doing an npm install of
esbuild
locally in package.json. Apparently if you don’t have it locally, it tries to use docker.Since bundling is a framework feature, We should automatically identify if docker is required for asset bundling and configure your synth environment accordingly.