Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python38 and python310 targets #199

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased
* add .gitconfig file to Docker image to mark /CIRRUS-core and /CIRRUS-DAAC as safe
* Add python3.8 and python3.10 targets in the Dockerfile

## 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.
Expand Down
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,43 @@ RUN \

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 setuptools

# Python38 target
FROM core_base AS python38
ENV PYTHON_3_8_VERSION "3.8.16"
RUN \
dnf groupinstall "Development Tools" -y && \
dnf install openssl-devel bzip2-devel libffi-devel sqlite-devel -y && \
Copy link
Contributor

@gjclark gjclark Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to pull out common stuff like dnf install openssl-devel bzip2-devel libffi-devel sqlite-devel -y && \ to not have repeat lines of code? I don't know the answer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially. After what @mattp0 discovered + his recent changes, I think I am going to close this PR. This line in his changes FROM public.ecr.aws/lambda/python:3.9 as python3 makes me think these changes would probably not work well. I am keeping my CIRRUS-DAAC PR open, though.

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 setuptools


# Python3 target
FROM core_base AS python3
# Python 3
Expand Down
Loading