From 7e1b1a42fa201f5dbe4bfeeca3c3ee39f11c07ec Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Wed, 8 Jan 2020 18:12:22 +0100 Subject: [PATCH] LABEL the image with git rev, build date, maintainer, microbadger badge in README --- .circleci/config.yml | 1 + Dockerfile | 9 ++++++++- Makefile | 2 ++ README.md | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40965f2121..97c2c3406a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,7 @@ jobs: docker push ocrd/all:minimum-git docker push ocrd/all:medium-git docker push ocrd/all:maximum-git + curl -X POST "$MICROBADGER_WEBHOOK" || true workflows: version: 2 build-master: diff --git a/Dockerfile b/Dockerfile index 850d1084d8..88a97eaa88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,14 @@ # use OCR-D base container (from ubuntu:18.04) FROM ocrd/core -MAINTAINER OCR-D +ARG VCS_REF +ARG BUILD_DATE +LABEL \ + maintainer="https://ocr-d.de/kontakt" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/OCR-D/ocrd_all" \ + org.label-schema.build-date=$BUILD_DATE + ENV PREFIX=/usr/local ENV VIRTUAL_ENV $PREFIX diff --git a/Makefile b/Makefile index 5547a98274..299d0d99c0 100644 --- a/Makefile +++ b/Makefile @@ -473,6 +473,8 @@ docker-maximum docker-maximum-git: DOCKER_MODULES = $(OCRD_MODULES) # (maybe we should add --network=host here for smoother build-time?) docker%: Dockerfile $(DOCKER_MODULES) docker build \ + --build-arg VCS_REF=$$(git rev-parse --short HEAD) \ + --build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ --build-arg OCRD_MODULES="$(DOCKER_MODULES)" \ --build-arg PIP_OPTIONS="$(PIP_OPTIONS)" \ -t $(DOCKER_TAG):$(or $(*:-%=%),latest) . diff --git a/README.md b/README.md index c80fd98913..cc1e29f9d2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # OCR-D/ocrd_all [![Built on CircleCI](https://circleci.com/gh/OCR-D/ocrd_all.svg?style=svg)](https://circleci.com/gh/OCR-D/ocrd_all) -![Docker Automated build](https://img.shields.io/docker/automated/ocrd/all) [![MIT licensed](https://img.shields.io/github/license/OCR-D/ocrd_all)](https://github.com/OCR-D/ocrd_all/blob/master/LICENSE) +[![](https://images.microbadger.com/badges/image/ocrd/all:maximum.svg)](https://hub.docker.com/r/ocrd/all) This controls installation of all OCR-D modules from source (as git submodules).