-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
53 lines (40 loc) · 1.34 KB
/
Dockerfile
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
FROM mundialis/grass-py3-pdal:stable-ubuntu
# copy swimpy and dependencies
RUN mkdir -p /code/swimpy
WORKDIR /code/swimpy
COPY . .
RUN chmod -R a+rwx /code
# Make sure python3 is the default python
RUN rm -f /usr/bin/python && \
ln -s $(which python3) /usr/bin/python
# Install swimpy
RUN pip3 install setuptools wheel && \
pip3 install -U numpy ipython && \
pip3 install -r requirements.txt && \
pip3 install -U dependencies/modelmanager
RUN pip3 install -U /code/swimpy
# install swim
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
gfortran \
libnetcdf-dev libnetcdff-dev \
&& apt-get autoremove \
&& apt-get clean
RUN make -C dependencies/swim/code clean && \
make -C dependencies/swim/code && \
mv dependencies/swim/code/swim /usr/bin
RUN make -C dependencies/swim/code clean && \
make -C dependencies/swim/code CLIMNCDF=1 && \
mv dependencies/swim/code/swim /usr/bin/swim-netcdf
# dedicated user
RUN useradd -m -U swim
USER swim
# Install m.swim (needs to be done after a new user is created)
RUN grass dependencies/m.swim/test/grassdb/utm32n/PERMANENT \
--exec g.extension m.swim url=dependencies/m.swim
# run tests
RUN cd dependencies/swim/project && swim-netcdf ./
RUN make -C dependencies/m.swim/test
RUN make -C tests
# clean up
WORKDIR /data