From 22880dd486cc6b346b33817d3d91452d25559279 Mon Sep 17 00:00:00 2001 From: Saket Chaudhary Date: Mon, 6 May 2024 20:02:28 +0530 Subject: [PATCH] aws cli --- dockerfiles/Dockerfile.ruby32 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dockerfiles/Dockerfile.ruby32 b/dockerfiles/Dockerfile.ruby32 index 339f171..c92a33f 100644 --- a/dockerfiles/Dockerfile.ruby32 +++ b/dockerfiles/Dockerfile.ruby32 @@ -11,6 +11,13 @@ RUN useradd -m newrelic-lambda-layers USER newrelic-lambda-layers WORKDIR /home/newrelic-lambda-layers +# Create a virtual environment for the AWS CLI and install it +RUN python3 -m venv awscli-venv +RUN . awscli-venv/bin/activate && pip install awscli + +# Set the PATH to include the virtual environment's bin directory +ENV PATH="/home/newrelic-lambda-layers/awscli-venv/bin:$PATH" + # Ruby layer building depends on the shared `libBuild.sh` script but is # otherwise independent. Copy over only what we need to build Ruby layers. COPY --chown=newrelic-lambda-layers libBuild.sh . @@ -18,10 +25,6 @@ COPY --chown=newrelic-lambda-layers ruby ruby/ WORKDIR ruby - -RUN python3 -m venv awscli-venv -RUN . awscli-venv/bin/activate && pip install awscli - # Run ruby/bin/clean just in case Docker is being ran from a developer's # workstation and their git clone directory has some stray files that could # conflict.