-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1333 from TheSylex/fix-docker-build
fixed docker builds by migrating to micromamba
- Loading branch information
Showing
1 changed file
with
11 additions
and
8 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,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" | ||
|