Skip to content

Commit

Permalink
Update Docker image
Browse files Browse the repository at this point in the history
- Use multi-stage build to decrease image size
- User osmctools form from mjaschen, for the patch of new state.txt
  format on OSM Diff server

ref: https://www.marcusjaschen.de/blog/2021/osmupdate-error-timestamp/
  • Loading branch information
Hsieh Chin Fan committed Nov 6, 2021
1 parent 81d3e5e commit a3cd0b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
FROM debian:buster-slim
FROM debian:buster-slim AS base
LABEL Description="Tilemaker" Version="a818597"

# install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl unzip osmctools jq git
ca-certificates curl unzip jq git wget

COPY . /
WORKDIR /

FROM base AS build

RUN apt-get install -y --no-install-recommends \
dh-autoreconf zlib1g-dev

# This zip file comes from latest Github Action artifacts:
# https://github.com/systemed/tilemaker/actions/runs/107305749
# Build from https://github.com/typebrook/tilemaker/tree/a818597 (2021.10.27)
RUN unzip /tilemaker-ubuntu-18.04.zip && \
chmod +x /build/tilemaker && \
mv /build/tilemaker /usr/bin/tilemaker && \
jq '.settings.compress="none"' /resources/config-openmaptiles.json >/tmp/bak && \
mv /tmp/bak /resources/config-openmaptiles.json
install /build/tilemaker /usr/local/bin

RUN git clone https://github.com/ramunasd/osmctools && \
cd osmctools && \
autoreconf --install && ./configure && make install

FROM base

COPY --from=build /usr/local/bin ./usr/local/bin
COPY --from=build /usr/bin ./usr/bin

ENTRYPOINT ["tilemaker"]
2 changes: 1 addition & 1 deletion .github/workflows/generate-tiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
generate-tiles:
runs-on: ubuntu-latest
container:
image: ghcr.io/typebrook/mapstew:a818597
image: ghcr.io/typebrook/mapstew:a818597.2
credentials:
username: typebrook
password: ${{ secrets.DOCKER_CONTAINER_REGISTRY_TOKEN }}
Expand Down

0 comments on commit a3cd0b4

Please sign in to comment.