From a331cbd9cd9724604d838cd9a059bc4dff24ae35 Mon Sep 17 00:00:00 2001 From: TheSylex <> Date: Wed, 26 Jun 2024 18:32:16 +0000 Subject: [PATCH] migrated to micromamba, environment.yml is fine but mamba solver sucks so it fails --- Dockerfile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17579f9b7..e08b1ab59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,26 @@ # See https://opendrift.github.io for usage -FROM condaforge/mambaforge +# Use a minimal base image +FROM mambaorg/micromamba:1.4.2 -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive +ENV MAMBA_DOCKERFILE_ACTIVATE=1 -RUN mkdir /code -WORKDIR /code +RUN mkdir code +WORKDIR code -# Install opendrift environment into base conda environment +# Copy environment file COPY environment.yml . -RUN mamba env update -n base -f environment.yml + +# Install opendrift environment into base micromamba environment +RUN micromamba install -n base -f environment.yml # Cache cartopy maps RUN /bin/bash -c "echo -e \"import cartopy\nfor s in ('c', 'l', 'i', 'h', 'f'): cartopy.io.shapereader.gshhs(s)\" | python" # Install opendrift -ADD . /code +ADD . . RUN pip install -e . # Test installation RUN /bin/bash -c "echo -e \"import opendrift\" | python" -