diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e5353..273dfac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,11 @@ ## Unreleased * add .gitconfig file to Docker image to mark /CIRRUS-core and /CIRRUS-DAAC as safe + +## v18.3.1.1 * Update the Makefile so that `make image` can be run without having set any environment variables. +* update core image to build from aws/lambda/python:3.9 as the python3 target ## v18.3.1.0 * Added separate urs_tea_client_id and urs_tea_client_password that can be specified if these are different from the non-tea versions of the variables. @@ -18,7 +21,7 @@ specified log group already exists" error: `make import-thin-egress-log` * Update Dockerfile: * FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1) * LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format - * NODE_VERSION="20.x" + * NODE_VERSION="20.x" * TERRAFORM_VERSION="1.9.2" * AWS_CLI_VERSION="2.17.13" * Upgrade to amazonlinux:2023 from amazonlinux:2 diff --git a/Dockerfile b/Dockerfile index f605186..b520bef 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,27 @@ 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 +RUN python3 -m pip install boto3 setuptools + # Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-core' # Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-DAAC' # 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 []