Skip to content

Commit

Permalink
Merge pull request #1333 from TheSylex/fix-docker-build
Browse files Browse the repository at this point in the history
fixed docker builds by migrating to micromamba
  • Loading branch information
knutfrode authored Jun 26, 2024
2 parents d208edb + a331cbd commit de17e15
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit de17e15

Please sign in to comment.