-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BUILD_TAUDEMEXT option; Build image based on ghcr.io/lreis2415/ta…
…udem_ext
- Loading branch information
Showing
4 changed files
with
77 additions
and
5 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
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
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## | ||
# | ||
# Copyright 2024 Liang-Jun Zhu <zlj@lreis.ac.cn> | ||
# | ||
|
||
# Use the latest master branch of TauDEM_ext image based on continuumio/miniconda3 as the build and test container, which is based on debian:12.5-slim | ||
# https://github.com/ContinuumIO/docker-images/blob/main/miniconda3/debian/Dockerfile | ||
# https://github.com/lreis2415/TauDEM_ext/pkgs/container/taudem_ext | ||
FROM ghrc.io/lreis2415/taudem_ext:master-debian-miniconda as builder | ||
|
||
LABEL maintainer="Liang-Jun Zhu <zlj@lreis.ac.cn>" | ||
|
||
# Copy source directory | ||
WORKDIR /seims | ||
COPY CMakeLists.txt . | ||
COPY cmake cmake | ||
COPY seims seims | ||
|
||
RUN apt-get update -q && \ | ||
apt-get install -q -y --no-install-recommends cmake make g++ \ | ||
gdal-bin openmpi-bin libgdal-dev libopenmpi-dev \ | ||
libmongoc-1.0-0 libmongoc-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG INSTALL_DIR=/seims/dist | ||
RUN cd /seims \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake .. -DCMAKE_BUILD_TYPE=Release -DINSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TAUDEMEXT=0 \ | ||
&& make -j 8 \ | ||
&& make install -j 8 \ | ||
&& cd .. | ||
|
||
## Build final image | ||
FROM ghrc.io/lreis2415/taudem_ext:master-debian-miniconda as runner | ||
|
||
# Copy source directory | ||
WORKDIR /seims | ||
COPY seims seims | ||
COPY docker docker | ||
|
||
# Create new conda environment for pyseims | ||
# Refers to https://pythonspeed.com/articles/activate-conda-dockerfile/ | ||
RUN conda env create -f ./seims/pyseims_env.yml | ||
|
||
# Make RUN commands use the new environment: | ||
SHELL ["conda", "run", "--no-capture-output", "-n", "pyseims", "/bin/bash", "-c"] | ||
|
||
RUN apt-get update -q && \ | ||
apt-get install -q -y --no-install-recommends \ | ||
gdal-bin openmpi-bin libgomp1 tini libmongoc-1.0-0 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Order layers starting with less frequently varying ones | ||
ARG INSTALL_DIR=/seims/dist | ||
COPY --from=builder ${INSTALL_DIR}/bin/ /usr/local/bin/ | ||
COPY --from=builder ${INSTALL_DIR}/include/ /usr/local/include/ | ||
COPY --from=builder ${INSTALL_DIR}/lib/ /usr/local/lib/ | ||
COPY --from=builder ${INSTALL_DIR}/share/ /usr/local/share/ | ||
|
||
ENV OMPI_ALLOW_RUN_AS_ROOT=1 | ||
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | ||
|
||
COPY docker/docker-entrypoint.sh / | ||
WORKDIR /seims/seims | ||
ENTRYPOINT ["/usr/bin/tini", "--", "/docker-entrypoint.sh"] |
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