source: trunk/Dockerfile @ 959

Last change on this file since 959 was 959, checked in by djay, 4 years ago

Add Dockerfile created on #177 providing docker-compose environmeent solving issue reported on #175.

File size: 5.0 KB
Line 
1#
2# Base: Ubuntu 18.04 with updates and external packages
3#
4FROM ubuntu:bionic-20200713 AS base
5ARG DEBIAN_FRONTEND=noninteractive
6ARG BUILD_DEPS=" \
7    dirmngr \
8    gpg-agent \
9    software-properties-common \
10"
11ARG RUN_DEPS=" \
12    libcurl3-gnutls \
13    libfcgi \
14    libmapserver-dev \
15    libmozjs185-dev \
16    libpq5 \
17    libpython2.7 \
18    libxslt1.1 \
19    gdal-bin \
20    python \
21    r-base \
22"
23RUN set -ex \
24    && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
25    \
26    && add-apt-repository ppa:osgeolive/nightly \
27    && add-apt-repository ppa:ubuntugis/ppa \
28    && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
29    && add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' \
30    \
31    && apt-get install -y $RUN_DEPS \
32    \
33    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
34    && rm -rf /var/lib/apt/lists/*
35
36#
37# builder1: base image with zoo-kernel
38#
39FROM base AS builder1
40ARG DEBIAN_FRONTEND=noninteractive
41ARG BUILD_DEPS=" \
42    bison \
43    flex \
44    make \
45    autoconf \
46    gcc \
47    gettext-base \
48    \
49    libfcgi-dev \
50    libgdal-dev \
51    libjson-c-dev \
52    libssh2-1-dev \
53    libssl-dev \
54    libxml2-dev \
55    libxslt1-dev \
56    python-dev \
57    uuid-dev \
58    r-base-dev \
59"
60WORKDIR /zoo-project
61COPY . .
62
63RUN set -ex \
64    && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
65    \
66    && make -C ./thirds/cgic206 libcgic.a \
67    \
68    && cd ./zoo-project/zoo-kernel \
69    && autoconf \
70    && ./configure --with-python --with-js=/usr --with-mapserver=/usr --with-ms-version=7 --with-json=/usr --with-db-backend --prefix=/usr \
71    && make \
72    && make install \
73    \
74    # TODO: why not copied by 'make'?
75    && cp zoo_loader.cgi main.cfg /usr/lib/cgi-bin/ \
76    && cp ../zoo-services/hello-py/cgi-env/* /usr/lib/cgi-bin/ \
77    && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \
78    && cp ../zoo-api/js/* /usr/lib/cgi-bin/ \
79    && cp ../zoo-services/hello-py/cgi-env/* /usr/lib/cgi-bin/ \
80    && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \
81    && cp ../zoo-api/js/* /usr/lib/cgi-bin/ \
82    \
83    && cp oas.cfg /usr/lib/cgi-bin/ \
84    \
85    # TODO: main.cfg is not processed \
86    && prefix=/usr envsubst < main.cfg > /usr/lib/cgi-bin/main.cfg \
87    \
88    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
89    && rm -rf /var/lib/apt/lists/*
90
91#
92# Optional zoo modules build.
93#
94FROM base AS builder2
95ARG DEBIAN_FRONTEND=noninteractive
96ARG BUILD_DEPS=" \
97    bison \
98    flex \
99    make \
100    autoconf \
101    g++ \
102    gcc \
103    libc-dev \
104    libfcgi-dev \
105    libgdal-dev \
106    libxml2-dev \
107    libxslt1-dev \
108"
109WORKDIR /zoo-project
110COPY ./zoo-project/zoo-services/utils/status ./zoo-project/zoo-services/utils/status
111
112# From zoo-kernel
113COPY --from=builder1 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
114COPY --from=builder1 /usr/lib/libzoo_service.so.1.5 /usr/lib/libzoo_service.so.1.5
115COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so
116COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/
117COPY --from=builder1 /usr/include/zoo/ /usr/include/zoo/
118
119# Additional files from bulder2
120COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/ZOOMakefile.opts /zoo-project/zoo-project/zoo-kernel/ZOOMakefile.opts
121COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/sqlapi.h /zoo-project/zoo-project/zoo-kernel/sqlapi.h
122COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/service.h /zoo-project/zoo-project/zoo-kernel/service.h
123COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/service_internal.h /zoo-project/zoo-project/zoo-kernel/service_internal.h
124COPY --from=builder1 /zoo-project/zoo-project/zoo-kernel/version.h /zoo-project/zoo-project/zoo-kernel/version.h
125
126RUN set -ex \
127    && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
128    \
129    && cd ./zoo-project/zoo-services/utils/status \
130    && make \
131    && make install \
132    \
133    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
134    && rm -rf /var/lib/apt/lists/*
135
136#
137# Runtime image with apache2.
138#
139FROM base AS runtime
140ARG DEBIAN_FRONTEND=noninteractive
141ARG RUN_DEPS=" \
142    apache2 \
143    curl \
144"
145
146# From zoo-kernel
147COPY --from=builder1 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
148COPY --from=builder1 /usr/lib/libzoo_service.so.1.5 /usr/lib/libzoo_service.so.1.5
149COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so
150COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/
151COPY --from=builder1 /usr/include/zoo/ /usr/include/zoo/
152
153# From optional zoo modules
154COPY --from=builder2 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
155COPY --from=builder2 /usr/com/zoo-project/ /usr/com/zoo-project/
156
157RUN set -ex \
158    && apt-get update && apt-get install -y --no-install-recommends $RUN_DEPS \
159    \
160    && rm -rf /var/lib/apt/lists/* \
161    && a2enmod cgi
162
163EXPOSE 80
164CMD /usr/sbin/apache2ctl -D FOREGROUND
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png