-
Notifications
You must be signed in to change notification settings - Fork 53
/
Dockerfile.alpine
75 lines (61 loc) · 2.37 KB
/
Dockerfile.alpine
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
# Fetch stage #################################################################
FROM alpine:3.17 AS fetchstage
# Setup fetch deps
RUN set -ex && \
apk update && \
apk add --no-cache --virtual .fetch-deps git
# Fetch source code
RUN set -x && \
mkdir -p ctbtemp && cd ctbtemp && \
git clone -b master-quantized-mesh --depth 1 \
https://github.com/ahuarte47/cesium-terrain-builder.git && \
cd cesium-terrain-builder
# Cleanup
RUN set -x && \
apk del .fetch-deps
# Build stage #################################################################
FROM alpine:3.12 AS buildstage
COPY --from=fetchstage /ctbtemp /ctbtemp
ARG gdal_version='3.1.4-r4'
ENV GDAL_VERSION=${gdal_version}
# Setup build deps
RUN set -ex && \
apk update && \
apk add --no-cache --virtual .build-deps \
make cmake libxml2-dev g++ gdal-dev
# Build & install cesium terrain builder
RUN set -x && \
cd /ctbtemp/cesium-terrain-builder && \
mkdir build && cd build && cmake .. && make install .
# Cleanup
RUN set -x && \
apk del .build-deps && \
rm -rf /tmp/* && \
rm -rf /ctbtemp
# Runtime stage #########################################################################
FROM alpine:3.12 AS runtimestage
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/
ARG gdal_version='3.1.4-r0'
ENV GDAL_VERSION=${gdal_version}
WORKDIR /data
# Setup runtime deps
RUN set -ex && \
apk update && \
apk add --no-cache --virtual .rundeps \
bash gdal=$GDAL_VERSION gdal-tools=$GDAL_VERSION && \
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 && \
rm -rf /tmp/*
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/cesium-terrain-builder-docker"
LABEL docker.image="tumgis/ctb-quantized-mesh"
LABEL docker.image.tag "alpine"