-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update docker builds * limit platforms * cleanups
- Loading branch information
Showing
5 changed files
with
59 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,73 @@ | ||
FROM condaforge/mambaforge:latest as build | ||
MAINTAINER Connor Manning <connor@hobu.co> | ||
ARG BASE_IMAGE="ubuntu:22.04" | ||
FROM --platform=$TARGETPLATFORM condaforge/mambaforge:latest as build | ||
|
||
ARG branch=master | ||
RUN echo Branch: $branch | ||
ADD https://api.github.com/repos/connormanning/entwine/commits?sha=$branch \ | ||
/tmp/bust-cache | ||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
ARG BRANCH=master | ||
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \ | ||
&& printf ", TARGETARCH=${TARGETARCH}" \ | ||
&& printf ", TARGETVARIANT=${TARGETVARIANT} \n" \ | ||
&& printf "With uname -s : " && uname -s \ | ||
&& printf "and uname -m : " && uname -m \ | ||
&& printf "and branch: ${BRANCH}" | ||
|
||
|
||
SHELL ["conda", "run", "-n", "base", "/bin/bash", "-c"] | ||
#RUN echo Branch: $branch | ||
#ADD https://api.github.com/repos/connormanning/entwine/commits?sha=$branch \ | ||
# /tmp/bust-cache | ||
|
||
RUN mamba install -c conda-forge ninja cmake compilers | ||
RUN mamba install -c conda-forge entwine --only-deps | ||
RUN mamba install -c conda-forge conda-pack -y | ||
RUN mamba create -n build -y -c conda-forge ninja cmake compilers | ||
RUN mamba create -n entwine -y | ||
|
||
SHELL ["conda", "run", "-n", "build", "/bin/bash", "-c"] | ||
|
||
RUN mamba install -y -c conda-forge entwine --only-deps | ||
|
||
RUN git clone https://github.com/connormanning/entwine.git /var/entwine && \ | ||
cd /var/entwine && \ | ||
git checkout $branch && \ | ||
git checkout $BRANCH && \ | ||
mkdir build && \ | ||
cd build && \ | ||
cmake -G Ninja \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ | ||
-DCMAKE_BUILD_TYPE=Release .. && \ | ||
ninja && \ | ||
ninja install | ||
|
||
ENTRYPOINT ["entwine"] | ||
SHELL ["conda", "run", "-n", "entwine", "/bin/bash", "-c"] | ||
|
||
ENV CONDA_ENV_NAME "entwine" | ||
ENV CONDAENV "/opt/conda/envs/${CONDA_ENV_NAME}" | ||
|
||
RUN mamba install -c conda-forge entwine --only-deps | ||
RUN cp /opt/conda/envs/build/bin/entwine $CONDAENV/bin/entwine | ||
RUN cp /opt/conda/envs/build/lib/libentwine.so* $CONDAENV/lib | ||
|
||
SHELL ["conda", "run", "-n", "base", "/bin/bash", "-c"] | ||
|
||
RUN conda-pack -n ${CONDA_ENV_NAME} --dest-prefix=/var/task -o /tmp/env.tar && \ | ||
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \ | ||
rm /tmp/env.tar | ||
|
||
FROM --platform=$TARGETPLATFORM ${BASE_IMAGE:?} as al2 | ||
|
||
ARG BASE_IMAGE | ||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
|
||
ENV CONDAENV "/var/task" | ||
ENV CONDA_PREFIX "/var/task" | ||
ENV TARGETPLATFORM "${TARGETPLATFORM}" | ||
COPY --from=build /venv ${CONDAENV} | ||
|
||
|
||
ENV PROJ_LIB ${CONDAENV}/share/proj | ||
ENV PROJ_NETWORK=TRUE | ||
ENV PATH $PATH:${CONDAENV}/bin | ||
ENV LD_LIBRARY_PATH=${CONDAENV}/lib | ||
|
||
SHELL [ "/bin/bash", "--login", "-c" ] | ||
|
||
ENTRYPOINT ["entwine"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.