Skip to content

Instantly share code, notes, and snippets.

@olafveerman
Last active December 4, 2018 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olafveerman/491594018fff7fcd928c20dcaaec7fb1 to your computer and use it in GitHub Desktop.
Save olafveerman/491594018fff7fcd928c20dcaaec7fb1 to your computer and use it in GitHub Desktop.
WIP Hello world for osmium-tool in Docker.
FROM debian:9
ENV OSMIUM_VERSION 2.14.2
ENV OSMIUMTOOL_VERSION 1.9.1
ENV PROTOZERO_VERSION 1.6.4
RUN mkdir /work
WORKDIR /work
RUN apt-get update && \
apt-get install -y \
--no-install-recommends \
ca-certificates \
build-essential \
libboost-program-options-dev \
libbz2-dev \
zlib1g-dev \
libexpat1-dev \
cmake \
wget && \
rm -rf /var/lib/apt/lists/*
# Download protozero, libosmium and osmium-tool from Github.
# Version in Debian are not recent enough
RUN wget https://github.com/mapbox/protozero/archive/v${PROTOZERO_VERSION}.tar.gz && \
tar -zxvf v${PROTOZERO_VERSION}.tar.gz && \
mv protozero-${PROTOZERO_VERSION} protozero && \
wget https://github.com/osmcode/libosmium/archive/v${OSMIUM_VERSION}.tar.gz && \
tar -zxvf v${OSMIUM_VERSION}.tar.gz && \
mv libosmium-${OSMIUM_VERSION} libosmium && \
wget https://github.com/osmcode/osmium-tool/archive/v${OSMIUMTOOL_VERSION}.tar.gz && \
tar -zxvf v${OSMIUMTOOL_VERSION}.tar.gz && \
mv osmium-tool-${OSMIUMTOOL_VERSION} osmium-tool
# Build osmium-tool. It will look for protozero and libosmium in the same
# folder as osmium-tool: https://github.com/osmcode/osmium-tool#prerequisites
RUN cd osmium-tool && \
mkdir build && \
cd build && \
cmake .. && \
make
RUN apt-get remove -y \
cmake \
build-essential && \
apt-get autoremove -y
RUN mv /work/osmium-tool/build/src/osmium /usr/bin/osmium
ENTRYPOINT ["osmium"]
CMD ["--help"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment