From af419986c4d5503728806dd2f3ff6551d7bdddf9 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Thu, 8 Aug 2024 16:16:35 -0600 Subject: [PATCH] feat: add python3.9 image --- Dockerfile | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index f605186..c5c471e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amazonlinux:2023 AS core_base +FROM public.ecr.aws/lambda/python:3.9 as python3 # This image can be used to do Python 3 & NodeJS development, and # includes the AWS CLI and Terraform. It contains: @@ -9,16 +9,20 @@ FROM amazonlinux:2023 AS core_base # * AWS CLI # * Terraform -ENV NODE_VERSION="20.x" -ENV TERRAFORM_VERSION="1.9.2" -ENV AWS_CLI_VERSION="2.17.13" +# Amazon Linux 2 does not support node 18.x or node 20.x glibc=2.27 and >=2.28 is required +ENV NODE_VERSION "16.x" +ENV TERRAFORM_VERSION "1.9.2" +ENV AWS_CLI_VERSION "2.17.13" -# Install NodeJS -RUN curl -fsSL https://rpm.nodesource.com/setup_${NODE_VERSION} | bash - -RUN dnf install -y nodejs +# Add NodeJS and Yarn repos & update package index +RUN \ + yum install https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y && \ + yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1 && \ + curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \ + yum update -y # CLI utilities -RUN dnf install -y gcc gcc-c++ git make openssl unzip wget zip jq +RUN yum install -y gcc gcc-c++ git make openssl unzip wget zip jq # AWS & Terraform RUN \ @@ -30,27 +34,25 @@ RUN \ unzip awscliv2.zip && \ ./aws/install +# Node JS +RUN \ + yum install -y nodejs yarn + # SSM SessionManager plugin RUN \ curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" &&\ - dnf install -y session-manager-plugin.rpm + yum install -y session-manager-plugin.rpm # Add user for keygen in Makefile ARG USER RUN \ echo "user:x:${USER}:0:root:/:/bin/bash" >> /etc/passwd -# Uncommenting breaks: CIRRUS-ASF's CI/CD -# Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-core' -# Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-DAAC' +RUN python3 -m pip install boto3 setuptools + # COPY .gitconfig /.gitconfig WORKDIR /CIRRUS-core -# Python3 target -FROM core_base AS python3 -# Python 3 -RUN \ - dnf install -y python3-devel && \ - dnf install -y python3-pip && \ - python3 -m pip install boto3 setuptools +# Bypass the bootstrap.sh script that runs in lambda +ENTRYPOINT []