Skip to content

Commit 50b9e4f

Browse files
committed
Improves docker setup for basic usage to get started more easily
1 parent 122c163 commit 50b9e4f

File tree

4 files changed

+68
-50
lines changed

4 files changed

+68
-50
lines changed

Dockerfile

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
1-
FROM debian:bullseye-slim AS src
1+
FROM debian:bookworm-slim AS src
22
LABEL Description="Tilemaker" Version="1.4.0"
33

4-
ARG DEBIAN_FRONTEND=noninteractive
5-
6-
# install dependencies
7-
RUN apt-get update && \
8-
apt-get install -y --no-install-recommends \
9-
build-essential \
10-
liblua5.1-0 \
11-
liblua5.1-0-dev \
12-
libsqlite3-dev \
13-
shapelib \
14-
libshp-dev \
15-
libboost-program-options-dev \
16-
libboost-filesystem-dev \
17-
libboost-system-dev \
18-
libboost-iostreams-dev \
19-
rapidjson-dev \
20-
cmake \
21-
zlib1g-dev
22-
23-
COPY CMakeLists.txt /
24-
COPY cmake /cmake
25-
COPY src /src
26-
COPY include /include
27-
COPY server /server
28-
29-
WORKDIR /build
30-
31-
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ ..
32-
RUN cmake --build .
33-
RUN strip tilemaker
34-
RUN strip tilemaker-server
35-
36-
FROM debian:bullseye-slim
37-
RUN apt-get update && \
38-
apt-get install -y --no-install-recommends \
39-
liblua5.1-0 \
40-
libshp-dev \
41-
libsqlite3-dev \
42-
libboost-filesystem-dev \
43-
libboost-program-options-dev \
44-
libboost-iostreams-dev
45-
WORKDIR /
46-
COPY --from=src /build/tilemaker .
47-
COPY resources /resources
48-
COPY process.lua .
49-
COPY config.json .
4+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
5+
build-essential \
6+
liblua5.1-0-dev \
7+
libsqlite3-dev \
8+
libshp-dev \
9+
libboost-program-options-dev \
10+
libboost-filesystem-dev \
11+
libboost-system-dev \
12+
libboost-iostreams-dev \
13+
rapidjson-dev \
14+
cmake \
15+
zlib1g-dev && \
16+
rm -rf /var/lib/apt/lists/*
17+
18+
WORKDIR /usr/src/app
19+
20+
COPY CMakeLists.txt ./
21+
COPY cmake ./cmake
22+
COPY src ./src
23+
COPY include ./include
24+
COPY server ./server
25+
26+
RUN mkdir build && \
27+
cd build && \
28+
cmake -DCMAKE_BUILD_TYPE=Release .. && \
29+
cmake --build . --parallel $(nproc) && \
30+
strip tilemaker && \
31+
strip tilemaker-server
32+
33+
34+
FROM debian:bookworm-slim
35+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
36+
liblua5.1-0 \
37+
shapelib \
38+
libsqlite3-0 \
39+
libboost-filesystem1.74.0 \
40+
libboost-program-options1.74.0 \
41+
libboost-iostreams1.74.0 && \
42+
rm -rf /var/lib/apt/lists/*
43+
44+
WORKDIR /usr/src/app
45+
COPY --from=src /usr/src/app/build/tilemaker .
46+
COPY --from=src /usr/src/app/build/tilemaker-server .
47+
COPY resources ./resources
48+
COPY process.lua ./
49+
COPY config.json ./
5050

5151
# Entrypoint for docker, wrapped with /bin/sh to remove requirement for executable permissions on script
52-
ENTRYPOINT ["/bin/sh", "/resources/docker-entrypoint.sh"]
52+
ENTRYPOINT ["/bin/sh", "/usr/src/app/resources/docker-entrypoint.sh"]
53+
CMD ["--help"]

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ See an example of a vector tile map produced by tilemaker at [tilemaker.org](htt
88

99
![Continuous Integration](https://github.com/systemed/tilemaker/workflows/Continuous%20Integration/badge.svg)
1010

11+
## Getting Started
12+
13+
We provide a ready-to-use docker image that gets you started without having to compile tilemaker from source:
14+
15+
1. Go to http://download.geofabrik.de/europe.html and download the `monaco-latest.osm.pbf` snapshot of OpenStreetMap
16+
17+
2. Run tilemaker on the OpenStreetMap snapshot to generate [Protomaps](https://protomaps.com) vector tiles:
18+
19+
docker run -it --rm -v (pwd):/data ghcr.io/systemed/tilemaker:master /data/monaco-latest.osm.pbf --output /data/monaco-latest.pmtiles
20+
21+
3. Check out what's in the vector tiles e.g. by using the debug viewer [here](https://protomaps.github.io/PMTiles/)
22+
23+
1124
## Installing
1225

1326
tilemaker is written in C++14. The chief dependencies are:

docs/INSTALL.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ Build from project root directory with:
6262

6363
The docker container can be run like this:
6464

65-
docker run -v /Users/Local/Downloads/:/srv -i -t --rm tilemaker /srv/germany-latest.osm.pbf --output=/srv/germany.mbtiles
65+
docker run -it --rm -v $(pwd):/data tilemaker /data/monaco-latest.osm.pbf --output /data/monaco-latest.pmtiles
66+
67+
The tilemaker-server can be run like this:
68+
69+
docker run -it --rm -v $(pwd):/data --entrypoint /usr/src/app/tilemaker-server tilemaker --help
6670

6771
Keep in mind to map the volume your .osm.pbf files are in to a path within your docker container, as seen in the example above.

resources/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ echo "DOCKER WARNING: The --store option can be used to partly reduce memory usa
66
echo "--------------------------------------------------------------------------------" >&2
77

88
# Proceed to run the command passed to the script
9-
exec /tilemaker "$@"
9+
exec /usr/src/app/tilemaker "$@"

0 commit comments

Comments
 (0)