Skip to content

Commit

Permalink
feat: add python3.9 image
Browse files Browse the repository at this point in the history
  • Loading branch information
mattp0 committed Aug 8, 2024
1 parent 66cd27f commit 4ce69d2
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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 \
Expand All @@ -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 []

0 comments on commit 4ce69d2

Please sign in to comment.