Skip to content

Commit

Permalink
Simplify osm-processor image and reduce size (#340)
Browse files Browse the repository at this point in the history
* build: simplify osm-processor image, use deb pkgs, reduce size

* build: update references to osmseed-osm-processor:v3

* docs: update docs for building osmseed-osm-processor img
  • Loading branch information
spwoodcock authored Sep 10, 2024
1 parent a6887ec commit f70c84f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 78 deletions.
2 changes: 1 addition & 1 deletion images/full-history/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM developmentseed/osmseed-osm-processor:v2
FROM developmentseed/osmseed-osm-processor:v3

VOLUME /mnt/data
COPY ./start.sh /
Expand Down
92 changes: 20 additions & 72 deletions images/osm-processor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,73 +1,21 @@
FROM ubuntu:20.04
FROM debian:bookworm-slim
ENV workdir /mnt/data

RUN apt-get -y update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential \
libboost-program-options-dev \
libbz2-dev \
zlib1g-dev \
libexpat1-dev \
cmake \
pandoc \
git \
python3 \
python3-pip \
curl \
unzip \
wget \
software-properties-common \
libz-dev \
gdal-bin \
tar \
bzip2 \
clang \
default-jre \
default-jdk \
gradle \
apt-utils \
postgresql-client

# Install osmosis 0.48
RUN echo "osmosis"
RUN git clone https://github.com/openstreetmap/osmosis.git
WORKDIR osmosis
RUN git checkout bb0e592671a9bf0c48db1301cdc3d6085c88bae9
RUN mkdir "$PWD"/dist
RUN ./gradlew assemble
RUN tar -xvzf "$PWD"/package/build/distribution/*.tgz -C "$PWD"/dist/
RUN ln -s "$PWD"/dist/bin/osmosis /usr/bin/osmosis
RUN osmosis --version 2>&1 | grep "Osmosis Version"

# Install osmium-tool
RUN apt-get -y install \
libbz2-dev \
libgd-dev \
libosmium2-dev \
libprotozero-dev \
libsqlite3-dev \
make \
jq \
ca-certificates

# Other useful packages
RUN apt-get install -y \
osmium-tool \
pyosmium \
rsync \
tmux \
zsh

RUN pip install osmium

# Install AWS CLI
RUN pip install awscli

# Install GCP CLI
RUN curl -sSL https://sdk.cloud.google.com | bash
RUN ln -f -s /root/google-cloud-sdk/bin/gsutil /usr/bin/gsutil

# Install Azure CLI
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

WORKDIR $workdir
WORKDIR $workdir

# Installs osmosis v0.48.3 & osmium-tool v1.15.0
RUN set -ex \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install \
-y --no-install-recommends \
"osmosis" \
"osmium-tool" \
# Cloud provider CLIs
"awscli" \
"gsutil" \
"azure-cli" \
# Other useful packages
"rsync" \
"pyosmium" \
"tmux" \
"zsh" \
&& rm -rf /var/lib/apt/lists/*
4 changes: 2 additions & 2 deletions images/osm-processor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Base container for other containers in osmseed ecosystem, it contains:

```
cd osm-processor/
docker build -t osmseed-osm-processor:v1 .
docker build -t osmseed-osm-processor:v3 .
```

#### Access the container
Expand All @@ -19,5 +19,5 @@ Base container for other containers in osmseed ecosystem, it contains:
docker run --env-file ./../.env \
--network osm-seed_default \
-v $(pwd)/../osm-processor-data:/mnt/data \
-i -t osmseed-osm-processor:v1 bash
-i -t osmseed-osm-processor:v3 bash
```
2 changes: 1 addition & 1 deletion images/planet-dump/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM developmentseed/osmseed-osm-processor:v2
FROM developmentseed/osmseed-osm-processor:v3

VOLUME /mnt/data
COPY ./start.sh /
Expand Down
2 changes: 1 addition & 1 deletion images/populate-apidb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM developmentseed/osmseed-osm-processor:v2
FROM developmentseed/osmseed-osm-processor:v3

VOLUME /mnt/data
COPY ./start.sh /
Expand Down
2 changes: 1 addition & 1 deletion images/replication-job/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM developmentseed/osmseed-osm-processor:v2
FROM developmentseed/osmseed-osm-processor:v3

# Install Nginx
RUN apt-get update && \
Expand Down

0 comments on commit f70c84f

Please sign in to comment.