From 23812f2138a22ad3130a0bd37b4e4bec8ddfe2a4 Mon Sep 17 00:00:00 2001 From: Michael Meyers Date: Mon, 8 Nov 2021 15:02:13 -0500 Subject: [PATCH 1/2] Upgrade to alpine 3.14 and pre-create cdk.out directory with the correct permissions --- Dockerfile | 2 +- entrypoint.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d8fa44a..fcf2244 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.13 +FROM alpine:3.14 RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker && \ ln -sf /usr/bin/python3 /usr/bin/python diff --git a/entrypoint.sh b/entrypoint.sh index 5a2e705..4e06c6a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,6 +61,13 @@ function installPipRequirements(){ } function runCdk(){ + user=$(stat -c "%u" node_modules) + group=$(stat -c "%g" node_modules) + addgroup -g $group github + adduser -u $user -G github -D github + mkdir -p cdk.out + chown github:github cdk.out + echo "Run cdk ${INPUT_CDK_SUBCOMMAND} ${*} \"${INPUT_CDK_STACK}\"" set -o pipefail cdk ${INPUT_CDK_SUBCOMMAND} ${*} "${INPUT_CDK_STACK}" 2>&1 | tee output.log From 93bf9b659d5f766e160f4933d41cde9cd7131c5d Mon Sep 17 00:00:00 2001 From: Michael Meyers Date: Mon, 8 Nov 2021 17:10:03 -0500 Subject: [PATCH 2/2] use tabs --- entrypoint.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 4e06c6a..481af9f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,12 +61,12 @@ function installPipRequirements(){ } function runCdk(){ - user=$(stat -c "%u" node_modules) - group=$(stat -c "%g" node_modules) - addgroup -g $group github - adduser -u $user -G github -D github - mkdir -p cdk.out - chown github:github cdk.out + user=$(stat -c "%u" node_modules) + group=$(stat -c "%g" node_modules) + addgroup -g $group github + adduser -u $user -G github -D github + mkdir -p cdk.out + chown github:github cdk.out echo "Run cdk ${INPUT_CDK_SUBCOMMAND} ${*} \"${INPUT_CDK_STACK}\"" set -o pipefail