Skip to content

Commit

Permalink
Add optional BUILD_DEBUG build argument (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
oobayly authored Oct 18, 2024
1 parent b863710 commit 94c0040
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM debian:bookworm-slim AS src
LABEL Description="Tilemaker" Version="1.4.0"

ARG BUILD_DEBUG=

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
liblua5.1-0-dev \
Expand All @@ -25,21 +27,33 @@ COPY server ./server

RUN mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
if [ -z "$BUILD_DEBUG" ]; then \
cmake -DCMAKE_BUILD_TYPE=Release ..; \
else \
cmake -DCMAKE_BUILD_TYPE=Debug ..; \
fi; \
cmake --build . --parallel $(nproc) && \
strip tilemaker && \
strip tilemaker-server
if [ -z "$BUILD_DEBUG" ]; then \
strip tilemaker && \
strip tilemaker-server; \
fi

ENV PATH="/usr/src/app/build:$PATH"

FROM debian:bookworm-slim

ARG BUILD_DEBUG=

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
liblua5.1-0 \
shapelib \
libsqlite3-0 \
lua-sql-sqlite3 \
libboost-filesystem1.74.0 \
libboost-program-options1.74.0 && \
if [ -n "$BUILD_DEBUG" ]; then \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gdb; \
fi; \
rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app
Expand Down
5 changes: 5 additions & 0 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ Build from project root directory with:

docker build . -t tilemaker

It can also be build with a `BUILD_DEBUG` build argument, which will build the executables for Debug, and not strip out symbols. `gdb` will also
installed to facilate debugging:

docker build . --build-arg BUILD_DEBUG=1 -t tilemaker

The docker container can be run like this:

docker run -it --rm -v $(pwd):/data tilemaker /data/monaco-latest.osm.pbf --output /data/monaco-latest.pmtiles
Expand Down

0 comments on commit 94c0040

Please sign in to comment.