-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (41 loc) · 1.5 KB
/
Dockerfile
File metadata and controls
51 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# windows:
# docker build -t zonal_stats_toolkit:latest . && docker run --rm -it -v "%CD%":/workdir zonal_stats_toolkit:latest
# linux/mac:
# docker build -t zonal_stats_toolkit:latest . && docker run --rm -it -v `pwd`:/workdir zonal_stats_toolkit:latest
FROM mambaorg/micromamba:1.4.2-bullseye
# We want all RUN commands to use Bash.
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Create the environment
RUN micromamba install -y -n base -c conda-forge \
python=3.11 gdal rasterio fiona geopandas pip
RUN micromamba shell init -s bash -p /opt/conda
# If needed, ensure the file exists and append your activation line
RUN touch /home/mambauser/.bashrc
RUN echo 'micromamba activate base' >> /home/mambauser/.bashrc
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
htop \
gcc \
g++ \
make \
build-essential \
zlib1g-dev \
libpython3-dev \
libssl-dev \
libffi-dev \
libsqlite3-dev \
libgdal-dev
ARG CACHEBUST=3
ARG WORKDIR=/workdir
ENV WORKDIR=${WORKDIR}
WORKDIR ${WORKDIR}
COPY requirements.txt /tmp/requirements.txt
RUN micromamba run -n base pip install -r /tmp/requirements.txt
RUN git clone https://github.com/springinnovate/ecoshard.git /usr/local/ecoshard && \
cd /usr/local/ecoshard && \
micromamba run -n base pip install --no-build-isolation . && \
git log -1 --format='%h on %ci' > /usr/local/ecoshard.gitversion
RUN useradd -ms /bin/bash user && chown -R user:user ${WORKDIR} /usr/local/ecoshard
USER user
CMD ["/bin/bash"]