question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CDK Pipelines] Asset bundling (running Docker during 'synth') doesn't work

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

16reactions
vermontkidsdatacommented, Feb 7, 2022

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.

8reactions
eladbcommented, Jul 23, 2020

Since bundling is a framework feature, We should automatically identify if docker is required for asset bundling and configure your synth environment accordingly.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found