-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(containers): Install eccodes in icon container, use py3.12
- Loading branch information
Showing
1 changed file
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
# Build a virtualenv using the appropriate Debian release | ||
# * Install python3-venv for the built-in Python3 venv module (not installed by default) | ||
# * Install gcc libpython3-dev to compile C Python modules | ||
# * In the virtualenv: Update pip setuputils and wheel to support building new packages | ||
FROM debian:11-slim AS build | ||
RUN apt-get update && \ | ||
apt-get install --no-install-suggests --no-install-recommends --yes python3-venv gcc libpython3-dev && \ | ||
python3 -m venv /venv && \ | ||
/venv/bin/pip install --upgrade pip setuptools wheel | ||
# Build a virtualenv using miniconda | ||
# * Install required compilation tools for wheels via apt | ||
# * Install required non-python binaries via conda | ||
FROM quay.io/condaforge/miniforge3:latest AS build-venv | ||
RUN apt -qq update && apt -qq install -y build-essential | ||
RUN conda create -p /venv python=3.12 | ||
RUN /venv/bin/pip install --upgrade -q pip wheel setuptools | ||
RUN conda install -p /venv -q -y eccodes zarr | ||
|
||
# Build the virtualenv | ||
FROM build AS build-venv | ||
RUN /venv/bin/python -m pip install zarr xarray ocf_blosc2 huggingface_hub requests | ||
# * We don't want the bufr eccodes definitions so save space by deleting them | ||
FROM build-venv as install-reqs | ||
RUN /venv/bin/python -m pip install -q xarray ocf_blosc2 huggingface_hub requests | ||
RUN rm -r /venv/share/eccodes/definitions/bufr | ||
|
||
# Copy the virtualenv into a distroless image | ||
FROM gcr.io/distroless/python3-debian11 | ||
COPY --from=build-venv /venv /venv | ||
COPY --from=install-reqs /venv /venv | ||
COPY . /app | ||
WORKDIR /app | ||
ENTRYPOINT ["/venv/bin/python3", "download_combine_upload_icon.py"] |