Skip to content

Commit

Permalink
Merge pull request #194 from asfadmin/dms/update/python
Browse files Browse the repository at this point in the history
PR-5950: Update Python to 3.10
  • Loading branch information
mckadesorensen authored Jul 15, 2024
2 parents 832167e + 4b861c8 commit 77c1959
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[safe]
directory = /CIRRUS-core
directory = /CIRRUS-DAAC
directory = /CIRRUS-DAAC
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* add a Makefile target to import tea lambda cloudwatch group if getting an "The
specified log group already exists" error: `make import-thin-egress-log`
* add .gitconfig file to Docker image to mark /CIRRUS-core and /CIRRUS-DAAC as safe
* Update Amazon linux to 2023
* Update python to 3.10

## v18.2.0.0

Expand Down
44 changes: 37 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazonlinux:2 as core_base
FROM amazonlinux:2023 as core_base
# This image can be used to do Python 3 & NodeJS development, and
# includes the AWS CLI and Terraform. It contains:

Expand Down Expand Up @@ -47,21 +47,51 @@ ARG USER
RUN \
echo "user:x:${USER}:0:root:/:/bin/bash" >> /etc/passwd

COPY .gitconfig /.gitconfig
#COPY .gitconfig /.gitconfig

WORKDIR /CIRRUS-core

# Python310 target
FROM core_base AS python310
ENV PYTHON_3_10_VERSION "3.10.14"
RUN \
dnf groupinstall "Development Tools" -y && \
dnf install openssl-devel bzip2-devel libffi-devel sqlite-devel -y && \
cd /usr/local && \
wget https://www.python.org/ftp/python/${PYTHON_3_10_VERSION}/Python-${PYTHON_3_10_VERSION}.tgz && \
tar xzf Python-${PYTHON_3_10_VERSION}.tgz && cd Python-${PYTHON_3_10_VERSION} && \
./configure --enable-optimizations \
--enable-shared \
--enable-loadable-sqlite-extensions \
--prefix /usr/local \
LDFLAGS=-Wl,-rpath=/usr/local/lib && \
make altinstall && \
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 1 && \
python3 -m pip install boto3

# Python38 target
FROM core_base as python38
FROM core_base AS python38
ENV PYTHON_3_8_VERSION "3.8.16"
RUN \
amazon-linux-extras install python3.8 && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
dnf groupinstall "Development Tools" -y && \
dnf install openssl-devel bzip2-devel libffi-devel sqlite-devel -y && \
cd /usr/local && \
wget https://www.python.org/ftp/python/${PYTHON_3_8_VERSION}/Python-${PYTHON_3_8_VERSION}.tgz && \
tar xzf Python-${PYTHON_3_8_VERSION}.tgz && cd Python-${PYTHON_3_8_VERSION} && \
./configure --enable-optimizations \
--enable-shared \
--enable-loadable-sqlite-extensions \
--prefix /usr/local \
LDFLAGS=-Wl,-rpath=/usr/local/lib && \
make altinstall && \
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 1 && \
python3 -m pip install boto3


# Python3 target
FROM core_base as python3
FROM core_base AS python3
# Python 3
RUN \
yum install -y python3-devel && \
yum install -y python3-pip && \
python3 -m pip install boto3

0 comments on commit 77c1959

Please sign in to comment.