-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathDockerfile
64 lines (54 loc) · 2.37 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
# Fetch stage #################################################################
FROM debian:buster AS fetchstage
ARG FETCH_PACKAGES='git ca-certificates'
WORKDIR /ctbtemp
# Setup fetch packages
RUN set -x && apt-get update && \
apt-get install -y --no-install-recommends $FETCH_PACKAGES
# Fetch
RUN set -x && \
git clone -b master-quantized-mesh --depth 1 \
https://github.com/ahuarte47/cesium-terrain-builder.git && \
cd cesium-terrain-builder
# Build stage #################################################################
FROM debian:buster AS buildstage
ARG BUILD_PACKAGES='cmake build-essential libgdal-dev'
COPY --from=fetchstage /ctbtemp/cesium-terrain-builder /ctbtemp/cesium-terrain-builder
WORKDIR /ctbtemp/cesium-terrain-builder
# Steup build packages
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends $BUILD_PACKAGES
# Build & install cesium terrain builder
RUN set -x && \
ls -lahF && \
mkdir build && cd build && cmake .. && make install .
# Cleanup
RUN set -x && \
apt-get purge -y --auto-remove $BUILD_PACKAGES && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /ctbtemp
# Runtime stage ###############################################################
FROM debian:buster-slim
ARG RUNTIME_PACKAGES='gdal-bin'
COPY --from=buildstage /usr/local/include/ctb /usr/local/include/ctb
COPY --from=buildstage /usr/local/lib/libctb.so /usr/local/lib/libctb.so
COPY --from=buildstage /usr/local/bin/ctb-* /usr/local/bin/
WORKDIR /data
# Setup runtime packages and env
RUN set -x && apt-get update && \
apt-get install -y --no-install-recommends $RUNTIME_PACKAGES && \
ldconfig && \
echo 'shopt -s globstar' >> ~/.bashrc && \
echo 'alias ..="cd .."' >> ~/.bashrc && \
echo 'alias l="ls -CF --group-directories-first --color=auto"' >> ~/.bashrc && \
echo 'alias ll="ls -lFh --group-directories-first --color=auto"' >> ~/.bashrc && \
echo 'alias lla="ls -laFh --group-directories-first --color=auto"' >> ~/.bashrc
CMD ["bash"]
# Labels ######################################################################
LABEL maintainer="Bruno Willenborg"
LABEL maintainer.email="b.willenborg(at)tum.de"
LABEL maintainer.organization="Chair of Geoinformatics, Technical University of Munich (TUM)"
LABEL source.repo="https://github.com/tum-gis/https://github.com/tum-gis/cesium-terrain-builder-docker"
LABEL docker.image="tumgis/ctb-quantized-mesh"