UPDATE: I’m an idiot - I was overwriting the system $PATH with my use of job parameters. Fixed now.
I’m attempting to run custom jobs using CircleCI convenience images, specifically cimg/base:2022.01 and cimg/node:lts. The first step in each of my jobs is “checkout”, to pull the code from GitHub. That step is failing the first time the git executable is called, with the error:
/bin/sh: 10: git: not found exit status 127
I’ve tried multiple tags of the images, and even pulled cimg/base:current to my local environment, and verified I can run git commands inside that image when run locally. What am I doing wrong here?
Here are the relevant sections of my CircleCI config:
jobs: scan-js: docker: image: cimg/node:lts parameters: path: type: string default: "." environment: PATH: << parameters.path >> steps: - checkout - run: | cd $PATH npm install - snyk/scan: organization: DevTech-ADVISE severity-threshold: medium scan-container: docker: image: cimg/base:2022.01 parameters: dockerfile-name: type: string default: "./Dockerfile" image_name: type: string default: myrepo/myapp path: type: string default: "." environment: DOCKERFILE_NAME: << parameters.dockerfile-name >> IMAGE_NAME: << parameters.image_name >> PATH: << parameters.path >> steps: - setup_remote_docker: version: 19.03.13 - checkout - run: | export DOCKER_CONTENT_TRUST=1 docker build -t $IMAGE_NAME -f $DOCKERFILE_NAME $PATH - snyk/scan: docker-image-name: $IMAGE_NAME organization: DevTech-ADVISE severity-threshold: medium target-file: $DOCKERFILE_PATH - run: | chmod +x ./docker_bench.sh ./docker_bench.sh $IMAGE_NAME