forked from openmaptiles/import-osm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (50 loc) · 1.86 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
FROM golang:1.11-buster
MAINTAINER "Yuri Astrakhan <[email protected]>"
ARG PG_MAJOR="11"
ARG IMPOSM_REPO="https://github.com/omniscale/imposm3.git"
ARG IMPOSM_VERSION="v0.8.1"
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
# install newer packages from backports
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libgeos-dev \
libleveldb-dev \
libprotobuf-dev \
osmctools \
osmosis \
# install postgresql client
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
postgresql-client-$PG_MAJOR \
&& ln -s /usr/lib/libgeos_c.so /usr/lib/libgeos.so \
&& rm -rf /var/lib/apt/lists/*
# add github.com/julien-noblet/download-geofabrik
RUN go get github.com/julien-noblet/download-geofabrik \
&& go install github.com/julien-noblet/download-geofabrik \
&& download-geofabrik generate \
# add github.com/lukasmartinelli/pgclimb
&& go get github.com/lukasmartinelli/pgclimb \
&& go install github.com/lukasmartinelli/pgclimb \
# add github.com/omniscale/imposm3
&& mkdir -p $GOPATH/src/github.com/omniscale/imposm3 \
&& cd $GOPATH/src/github.com/omniscale/imposm3 \
&& go get github.com/tools/godep \
# && git clone --quiet --depth 1 https://github.com/omniscale/imposm3 \
#
# update to current omniscale/imposm3
&& git clone --quiet --depth 1 $IMPOSM_REPO -b $IMPOSM_VERSION \
$GOPATH/src/github.com/omniscale/imposm3 \
&& make build \
&& ( [ -f imposm ] && mv imposm /usr/bin/imposm || mv imposm3 /usr/bin/imposm ) \
# clean
&& rm -rf $GOPATH/bin/godep \
&& rm -rf $GOPATH/src/ \
&& rm -rf $GOPATH/pkg/
VOLUME /import /cache /mapping
ENV IMPORT_DIR=/import \
IMPOSM_CACHE_DIR=/cache \
MAPPING_YAML=/mapping/mapping.yaml \
DIFF_DIR=/import \
TILES_DIR=/import \
CONFIG_JSON=config.json
WORKDIR /usr/src/app
COPY . /usr/src/app/
CMD ["./import_osm.sh"]