From 607fe61ff0460084e00a4fde2bc70df4673282dc Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 5 May 2020 10:42:12 +0900 Subject: [PATCH 1/2] Update nominatim to version 3.4.2 --- .circleci/config.yml | 10 ++++++---- Dockerfile | 5 +++-- README.md | 6 ++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc5fcae..3c8e90e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,15 +62,17 @@ jobs: command: | echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin IMAGE_TAG=${CIRCLE_TAG/v/''} + APP_TAG=$(docker inspect $IMAGE_NAME:latest | jq -r '. | first | .ContainerConfig.Labels."app.tag"') + docker tag $IMAGE_NAME:latest $IMAGE_NAME:latest-$APP_TAG docker tag $IMAGE_NAME:latest $IMAGE_NAME:$IMAGE_TAG - docker push $IMAGE_NAME:latest - docker push $IMAGE_NAME:$IMAGE_TAG - # If the minor version can be extracted then tag and push + docker tag $IMAGE_NAME:latest $IMAGE_NAME:$IMAGE_TAG-$APP_TAG + # If the minor version can be extracted then tag MINOR_VERSION=$(echo $CIRCLE_TAG | sed -n "s/^v\([0-9]*.[0-9]*\).[0-9]*$/\1/p") if [[ ${#MINOR_VERSION} -gt 0 ]]; then docker tag $IMAGE_NAME:latest $IMAGE_NAME:$MINOR_VERSION - docker push $IMAGE_NAME:$MINOR_VERSION + docker tag $IMAGE_NAME:latest $IMAGE_NAME:$MINOR_VERSION-$APP_TAG fi + docker push $IMAGE_NAME workflows: version: 2 build: diff --git a/Dockerfile b/Dockerfile index 0a6d61d..b960bd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM peterevans/xenial-gcloud:1.2.23 as builder -ENV NOMINATIM_VERSION 3.4.1 +ENV NOMINATIM_VERSION 3.4.2 # Let the container know that there is no TTY ARG DEBIAN_FRONTEND=noninteractive @@ -48,7 +48,8 @@ LABEL \ org.opencontainers.image.authors="Peter Evans " \ org.opencontainers.image.url="https://github.com/peter-evans/nominatim-k8s" \ org.opencontainers.image.vendor="https://peterevans.dev" \ - org.opencontainers.image.licenses="MIT" + org.opencontainers.image.licenses="MIT" \ + app.tag="nominatim$NOMINATIM_VERSION" # Let the container know that there is no TTY ARG DEBIAN_FRONTEND=noninteractive diff --git a/README.md b/README.md index edac077..01cec5e 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,11 @@ This Docker image and sample Kubernetes configuration files are one solution to ## Supported tags and respective `Dockerfile` links -- [`2.5.3`, `2.5`, `latest` (*2.5/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v2.5.3) +- [`2.5.4`, `2.5`, `latest`, `2.5.4-nominatim3.4.2`, `2.5-nominatim3.4.2`, `latest-nominatim3.4.2` (*2.5/Dockerfile*)](https://github.com/peter-evans/nominatim-docker/tree/v2.5.4) +- [`2.5.3` (*2.5/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v2.5.3) - [`2.4.0`, `2.4` (*2.4/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v2.4.0) - [`2.3.3`, `2.3` (*2.3/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v2.3.3) - [`2.2.0`, `2.2` (*2.2/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v2.2.0) -- [`2.1.0`, `2.1` (*2.1/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v2.1.0) -- [`2.0.1`, `2.0` (*2.0/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v2.0.1) -- [`1.2.0`, `1.2` (*1.2/Dockerfile*)](https://github.com/peter-evans/nominatim-k8s/tree/v1.2.0) ## Usage The Docker image can be run standalone without Kubernetes: From dba12abc3604846aed18d3ce995dab82f5d70bb2 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 5 May 2020 11:47:04 +0900 Subject: [PATCH 2/2] Set version via global arg --- .circleci/config.yml | 4 ++++ Dockerfile | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c8e90e..f638be1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,6 +37,10 @@ jobs: name: Load cached Docker image command: | docker load -i /tmp/workspace/latest.tar + - run: + name: Inspect Docker image + command: | + docker inspect $IMAGE_NAME:latest - run: name: Test Docker image command: | diff --git a/Dockerfile b/Dockerfile index b960bd0..d98cb5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ +ARG nominatim_version=3.4.2 + FROM peterevans/xenial-gcloud:1.2.23 as builder -ENV NOMINATIM_VERSION 3.4.2 +ARG nominatim_version # Let the container know that there is no TTY ARG DEBIAN_FRONTEND=noninteractive @@ -28,10 +30,10 @@ RUN apt-get -y update \ # Build Nominatim RUN cd /srv \ - && curl --silent -L http://www.nominatim.org/release/Nominatim-$NOMINATIM_VERSION.tar.bz2 -o v$NOMINATIM_VERSION.tar.bz2 \ - && tar xf v$NOMINATIM_VERSION.tar.bz2 \ - && rm v$NOMINATIM_VERSION.tar.bz2 \ - && mv Nominatim-$NOMINATIM_VERSION nominatim \ + && curl --silent -L http://www.nominatim.org/release/Nominatim-${nominatim_version}.tar.bz2 -o v${nominatim_version}.tar.bz2 \ + && tar xf v${nominatim_version}.tar.bz2 \ + && rm v${nominatim_version}.tar.bz2 \ + && mv Nominatim-${nominatim_version} nominatim \ && cd nominatim \ && mkdir build \ && cd build \ @@ -41,6 +43,8 @@ RUN cd /srv \ FROM peterevans/xenial-gcloud:1.2.23 +ARG nominatim_version + LABEL \ maintainer="Peter Evans " \ org.opencontainers.image.title="nominatim-k8s" \ @@ -49,7 +53,7 @@ LABEL \ org.opencontainers.image.url="https://github.com/peter-evans/nominatim-k8s" \ org.opencontainers.image.vendor="https://peterevans.dev" \ org.opencontainers.image.licenses="MIT" \ - app.tag="nominatim$NOMINATIM_VERSION" + app.tag="nominatim${nominatim_version}" # Let the container know that there is no TTY ARG DEBIAN_FRONTEND=noninteractive