diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile b/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile index 54969bb5fde2c..21dbeeaaf2072 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile @@ -1,6 +1,6 @@ # The correct AWS SAM build image based on the runtime of the function will be # passed as build arg. The default allows to do `docker build .` when testing. -ARG IMAGE=public.ecr.aws/sam/build-nodejs14.x +ARG IMAGE=public.ecr.aws/sam/build-nodejs18.x FROM $IMAGE # Install yarn diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts index d1b85dfcca2b8..9336d92f58b3a 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts @@ -1,8 +1,11 @@ import { spawnSync } from 'child_process'; import * as path from 'path'; +const docker = process.env.CDK_DOCKER ?? 'docker'; beforeAll(() => { - spawnSync('docker', ['build', '-t', 'esbuild', path.join(__dirname, '../lib')]); + const process = spawnSync(docker, ['build', '-t', 'esbuild', path.join(__dirname, '../lib')], { stdio: 'inherit' }); + expect(process.error).toBeUndefined(); + expect(process.status).toBe(0); }); test('esbuild is available', () => {