forked from GRASS-GIS/grass-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
95 lines (81 loc) · 2.13 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM ubuntu:16.04
MAINTAINER Vaclav Petras <wenzeslaus@gmail.com>
# system environment
ENV DEBIAN_FRONTEND noninteractive
# data directory - not using the base images volume because then the permissions cannot be adapted
ENV DATA_DIR /data
# GRASS GIS compile dependencies
RUN apt-get update \
&& apt-get install -y --install-recommends \
autoconf2.13 \
autotools-dev \
bison \
flex \
g++ \
gettext \
libblas-dev \
libbz2-dev \
libcairo2-dev \
libfftw3-dev \
libfreetype6-dev \
libgdal-dev \
libgeos-dev \
libglu1-mesa-dev \
libjpeg-dev \
liblapack-dev \
liblas-c-dev \
libncurses5-dev \
libnetcdf-dev \
libpng-dev \
libpq-dev \
libproj-dev \
libreadline-dev \
libsqlite3-dev \
libtiff-dev \
libxmu-dev \
make \
netcdf-bin \
proj-bin \
python \
python-dev \
python-numpy \
python-pil \
python-ply \
unixodbc-dev \
zlib1g-dev \
&& apt-get autoremove \
&& apt-get clean && \
mkdir -p $DATA_DIR
RUN mkdir /code
RUN mkdir /code/grass
# add repository files to the image
COPY . /code/grass
WORKDIR /code/grass
# install GRASS GIS
RUN ./configure \
--enable-largefile=yes \
--with-nls \
--with-cxx \
--with-readline \
--with-bzlib \
--with-pthread \
--with-proj-share=/usr/share/proj \
--with-geos=/usr/bin/geos-config \
--with-cairo \
--with-opengl-libs=/usr/include/GL \
--with-freetype=yes --with-freetype-includes="/usr/include/freetype2/" \
--with-sqlite=yes \
--with-liblas=yes --with-liblas-config=/usr/bin/liblas-config \
&& make -j2 && make install && ldconfig
# enable simple grass command regardless of version number
RUN ln -s /usr/local/bin/grass* /usr/local/bin/grass
# Fix permissions
RUN chmod -R a+rwx $DATA_DIR
# create a user
RUN useradd -m -U grass
# declare volume late so permissions apply
VOLUME $DATA_DIR
WORKDIR $DATA_DIR
# switch the user
USER grass
CMD ["/usr/local/bin/grass", "--version"]