diff --git a/Dockerfile b/Dockerfile index 91f7c3f..f445e1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,19 +15,18 @@ RUN apk add -U --no-cache \ RUN apk add --no-cache \ gcc libc-dev libffi-dev +# Install checkov and update PATH +COPY requirements.txt ./ +RUN pip install -r requirements.txt + # Create a non-root user and set file permissions RUN addgroup -S app \ && adduser -S -g app -u 1000 app \ - && chown -R app:app $HOME \ - && echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.bashrc + && chown -R app:app $HOME # Run as the non-root user USER 1000 -# Install checkov and update PATH -COPY requirements.txt ./ -RUN pip install -r requirements.txt - # Copy entrypoint COPY entrypoint.sh /usr/local/bin/entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 4abb3e1..f1ede67 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,9 +1,6 @@ #!/usr/bin/env bash set -e -# Ensure PATH is up to date -source ~/.bashrc - RUN_CHECKOV_POLICIES=${RUN_CHECKOV_POLICIES:-false} RUN_KYVERNO_POLICIES=${RUN_KYVERNO_POLICIES:-false} POLICY_REPO_DIR="${POLICY_REPO_DIR:-/tmp/policy}"