Skip to content

build: parallelize python pip installation and remove redudant python-pip install #149

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

Merged
merged 5 commits into from
Jan 13, 2025
Merged
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
44 changes: 19 additions & 25 deletions docker/development/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Apache License 2.0

FROM ubuntu:20.04 as base

Check warning on line 3 in docker/development/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push and Tag Base Image with Version / Build Development Image

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

LABEL maintainer="lucas.bremond@gmail.com"

Expand Down Expand Up @@ -79,39 +79,33 @@

## Python

RUN add-apt-repository ppa:deadsnakes/ppa

RUN apt-get update && apt-get install -y \
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && apt-get install -y --no-install-recommends \
python3.9 python3.9-distutils python3.9-dev \
python3.10 python3.10-distutils python3.10-dev \
python3.11 python3.11-distutils python3.11-dev \
python3.12 python3.12-dev \
python3.13 python3.13-dev
python3.13 python3.13-dev \
python3-dev \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9 && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13
## Pip

## Python tools
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9 \
& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 \
& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 \
& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 \
& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13 \
& wait

RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
python3-dev \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
## Python tools

RUN python3.9 -m pip install --upgrade pip ipython \
&& python3.10 -m pip install --upgrade pip ipython \
&& python3.11 -m pip install --upgrade pip ipython \
&& python3.12 -m pip install --upgrade pip ipython \
&& python3.13 -m pip install --upgrade pip ipython \
&& python3.9 -m pip install --upgrade setuptools build wheel twine pytest pybind11-stubgen \
&& python3.10 -m pip install --upgrade setuptools build wheel twine pytest pybind11-stubgen \
&& python3.11 -m pip install --upgrade setuptools build wheel twine pytest pybind11-stubgen \
&& python3.12 -m pip install --upgrade setuptools build wheel twine pytest pybind11-stubgen \
&& python3.13 -m pip install --upgrade setuptools build wheel twine pytest pybind11-stubgen
RUN python3.9 -m pip install --upgrade pip ipython setuptools build wheel twine pytest pybind11-stubgen \
& python3.10 -m pip install --upgrade pip ipython setuptools build wheel twine pytest pybind11-stubgen \
& python3.11 -m pip install --upgrade pip ipython setuptools build wheel twine pytest pybind11-stubgen \
& python3.12 -m pip install --upgrade pip ipython setuptools build wheel twine pytest pybind11-stubgen \
& python3.13 -m pip install --upgrade pip ipython setuptools build wheel twine pytest pybind11-stubgen \
& wait

## CMake

Expand Down Expand Up @@ -193,14 +187,14 @@
## Black

ARG OSTK_PYTHON_VERSION
ENV OSTK_PYTHON_VERSION 3.11

Check warning on line 190 in docker/development/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push and Tag Base Image with Version / Build Development Image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

RUN python${OSTK_PYTHON_VERSION} -m pip install black black[jupyter]

# Environment

ENV LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}

Check warning on line 196 in docker/development/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push and Tag Base Image with Version / Build Development Image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 196 in docker/development/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push and Tag Base Image with Version / Build Development Image

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV PYTHONPATH /usr/local/lib:${PYTHONPATH}

Check warning on line 197 in docker/development/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push and Tag Base Image with Version / Build Development Image

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHONPATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 197 in docker/development/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push and Tag Base Image with Version / Build Development Image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
RUN git config --global --add safe.directory /app

# Install development helpers
Expand Down Expand Up @@ -235,7 +229,7 @@

ARG VERSION

ENV VERSION ${VERSION}

Check warning on line 232 in docker/development/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push and Tag Base Image with Version / Build Development Image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

LABEL VERSION="${VERSION}"

Expand Down
Loading