Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS-CDK and Gitlab returns Error: spawnSync docker ENOENT

I am trying to run a Gitlab pipeline that builds an AWS-CDK project via the cdk-synth command. I have followed advice online in terms of what images I should be using in the Gitlab runner but I am running into the following error:

Error: spawnSync docker ENOENT

I'm not sure what this error means exactly, I guess it is trying to launch docker (which is used by thecdk synth command) but failing to do so. Again what I have found online all suggests to use the setup I currently have which is:

image: node:16.3.0-alpine

stages:
  - build
  - test
  - .post

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .npm
    - node_modules

build:
  tags:
    - mytag
  environment: ${CI_COMMIT_BRANCH}
  stage: build
  script:
    - npm i
    - cdk synth --no-staging > template.yaml
  artifacts:
    paths:
      - cdk.out
    expire_in: 30 mins

I'm really lost with this one, it may be staring me right in the face but could someone please point me in the right direction as to why i'd be getting this error when the image i'm using is itself a docker container?

like image 506
red house 87 Avatar asked Sep 13 '25 16:09

red house 87


1 Answers

I was stuck on this as well, but was able to get around it by adding esbuild as to my devDependencies in package.json.

like image 108
Dustin Avatar answered Sep 15 '25 06:09

Dustin