File: Dockerfile

package info (click to toggle)
mobilitydb 1.3.0~alpha-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 118,528 kB
  • sloc: ansic: 166,361; sql: 99,983; xml: 22,860; yacc: 447; makefile: 200; lex: 151; sh: 142
file content (55 lines) | stat: -rw-r--r-- 1,846 bytes parent folder | download
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
# Build stage
ARG POSTGRES_VERSION=17
ARG POSTGIS_VERSION=3.5

FROM postgis/postgis:${POSTGRES_VERSION}-${POSTGIS_VERSION} AS builder

# Install build dependencies
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential \
        cmake \
        libproj-dev \
        libjson-c-dev \
        libgsl-dev \
        libgeos-dev \
        postgresql-server-dev-${PG_MAJOR} \
    && rm -rf /var/lib/apt/lists/*

# Copy local MobilityDB source instead of downloading
WORKDIR /usr/local/src/MobilityDB
COPY . .

# Build MobilityDB
RUN mkdir -p build \
    && cd build \
    && rm -rf * \
    && cmake -DCMAKE_BUILD_TYPE=Release \
             -DNPOINT=on -DCBUFFER=on -DPOSE=on .. \
    && make -j$(nproc) \
    && make install

# Prepare initialization script
RUN cp docker/initdb-mobilitydb.sh /tmp/11_mobilitydb.sh

# Final stage
FROM postgis/postgis:${POSTGRES_VERSION}-${POSTGIS_VERSION}

# Configuration Parameters
LABEL maintainer="MobilityDB Project - https://github.com/MobilityDB/MobilityDB"
LABEL org.opencontainers.image.description="MobilityDB - An open source geospatial trajectory data management & analysis platform"
LABEL org.opencontainers.image.source="https://github.com/MobilityDB/MobilityDB"

# Install runtime dependencies only
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        libproj-dev \
        libjson-c-dev \
        libgsl-dev \
        libgeos-dev \
    && rm -rf /var/lib/apt/lists/*

# Copy MobilityDB installed files from builder
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/mobilitydb* /usr/share/postgresql/${PG_MAJOR}/extension/
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/libMobilityDB* /usr/lib/postgresql/${PG_MAJOR}/lib/
COPY --from=builder /tmp/11_mobilitydb.sh /docker-entrypoint-initdb.d/11_mobilitydb.sh