From 424ad3109b5b6adb4353dfb08cb26c1f3dd70fad Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 2 Mar 2020 22:18:11 +0100 Subject: [PATCH] Use opencontainers annotations (#4) --- Dockerfile-alpine.template | 1 + Dockerfile-debian.template | 1 + apache/Dockerfile | 17 ++++++++++------- fpm-alpine/Dockerfile | 17 ++++++++++------- fpm/Dockerfile | 17 ++++++++++------- update.sh | 18 +++++++++++------- 6 files changed, 43 insertions(+), 28 deletions(-) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 9b89236..3fa3423 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -1,5 +1,6 @@ FROM php:%%PHP_VERSION%%-%%VARIANT%% +# opencontainers annotations https://github.com/opencontainers/image-spec/blob/master/annotations.md %%LABEL%% # entrypoint.sh dependencies diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 632487b..afed693 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -1,5 +1,6 @@ FROM php:%%PHP_VERSION%%-%%VARIANT%% +# opencontainers annotations https://github.com/opencontainers/image-spec/blob/master/annotations.md %%LABEL%% # entrypoint.sh dependencies diff --git a/apache/Dockerfile b/apache/Dockerfile index 21071fc..8fe0e22 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,12 +1,15 @@ FROM php:7.3-apache +# opencontainers annotations https://github.com/opencontainers/image-spec/blob/master/annotations.md LABEL maintainer="Alexis Saettler (@asbiin)" \ - org.label-schema.name="MonicaHQ, the Personal Relationship Manager" \ - org.label-schema.description="This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you." \ - org.label-schema.url="https://monicahq.com" \ - org.label-schema.vcs-url="https://github.com/monicahq/monica" \ - org.label-schema.vendor="Monica" \ - org.label-schema.schema-version="1.0" + org.opencontainers.image.authors="Alexis Saettler " \ + org.opencontainers.image.title="MonicaHQ, the Personal Relationship Manager" \ + org.opencontainers.image.description="This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you." \ + org.opencontainers.image.url="https://monicahq.com" \ + org.opencontainers.image.revision="e3c79ada95ba6b34281628ee044a7bf0e9920f26" \ + org.opencontainers.image.source="https://github.com/monicahq/docker" \ + org.opencontainers.image.vendor="Monica" \ + org.opencontainers.image.version="v2.16.0" # entrypoint.sh dependencies RUN set -ex; \ @@ -63,7 +66,7 @@ RUN set -ex; \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.18; \ pecl install memcached-3.1.5; \ - pecl install redis-5.1.1; \ + pecl install redis-5.2.0; \ \ docker-php-ext-enable \ apcu \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 4d6a885..a738523 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,12 +1,15 @@ FROM php:7.3-fpm-alpine +# opencontainers annotations https://github.com/opencontainers/image-spec/blob/master/annotations.md LABEL maintainer="Alexis Saettler (@asbiin)" \ - org.label-schema.name="MonicaHQ, the Personal Relationship Manager" \ - org.label-schema.description="This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you." \ - org.label-schema.url="https://monicahq.com" \ - org.label-schema.vcs-url="https://github.com/monicahq/monica" \ - org.label-schema.vendor="Monica" \ - org.label-schema.schema-version="1.0" + org.opencontainers.image.authors="Alexis Saettler " \ + org.opencontainers.image.title="MonicaHQ, the Personal Relationship Manager" \ + org.opencontainers.image.description="This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you." \ + org.opencontainers.image.url="https://monicahq.com" \ + org.opencontainers.image.revision="e3c79ada95ba6b34281628ee044a7bf0e9920f26" \ + org.opencontainers.image.source="https://github.com/monicahq/docker" \ + org.opencontainers.image.vendor="Monica" \ + org.opencontainers.image.version="v2.16.0" # entrypoint.sh dependencies RUN set -ex; \ @@ -62,7 +65,7 @@ RUN set -ex; \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.18; \ pecl install memcached-3.1.5; \ - pecl install redis-5.1.1; \ + pecl install redis-5.2.0; \ \ docker-php-ext-enable \ apcu \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index e676d6f..e754b85 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,12 +1,15 @@ FROM php:7.3-fpm +# opencontainers annotations https://github.com/opencontainers/image-spec/blob/master/annotations.md LABEL maintainer="Alexis Saettler (@asbiin)" \ - org.label-schema.name="MonicaHQ, the Personal Relationship Manager" \ - org.label-schema.description="This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you." \ - org.label-schema.url="https://monicahq.com" \ - org.label-schema.vcs-url="https://github.com/monicahq/monica" \ - org.label-schema.vendor="Monica" \ - org.label-schema.schema-version="1.0" + org.opencontainers.image.authors="Alexis Saettler " \ + org.opencontainers.image.title="MonicaHQ, the Personal Relationship Manager" \ + org.opencontainers.image.description="This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you." \ + org.opencontainers.image.url="https://monicahq.com" \ + org.opencontainers.image.revision="e3c79ada95ba6b34281628ee044a7bf0e9920f26" \ + org.opencontainers.image.source="https://github.com/monicahq/docker" \ + org.opencontainers.image.vendor="Monica" \ + org.opencontainers.image.version="v2.16.0" # entrypoint.sh dependencies RUN set -ex; \ @@ -63,7 +66,7 @@ RUN set -ex; \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install APCu-5.1.18; \ pecl install memcached-3.1.5; \ - pecl install redis-5.1.1; \ + pecl install redis-5.2.0; \ \ docker-php-ext-enable \ apcu \ diff --git a/update.sh b/update.sh index eab36d2..0e51751 100755 --- a/update.sh +++ b/update.sh @@ -29,12 +29,14 @@ RUN set -eu; sed -ri -e \"s!/var/www/html!\\\${APACHE_DOCUMENT_ROOT}!g\" /etc/ap ) label="LABEL maintainer=\"Alexis Saettler (@asbiin)\" \\\\\\n\ - org.label-schema.name=\"MonicaHQ, the Personal Relationship Manager\" \\\\\\n\ - org.label-schema.description=\"This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you.\" \\\\\\n\ - org.label-schema.url=\"https://monicahq.com\" \\\\\\n\ - org.label-schema.vcs-url=\"https://github.com/monicahq/monica\" \\\\\\n\ - org.label-schema.vendor=\"Monica\" \\\\\\n\ - org.label-schema.schema-version=\"1.0\"" + org.opencontainers.image.authors=\"Alexis Saettler \" \\\\\\n\ + org.opencontainers.image.title=\"MonicaHQ, the Personal Relationship Manager\" \\\\\\n\ + org.opencontainers.image.description=\"This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you.\" \\\\\\n\ + org.opencontainers.image.url=\"https://monicahq.com\" \\\\\\n\ + org.opencontainers.image.revision=\"%%COMMIT%%\" \\\\\\n\ + org.opencontainers.image.source=\"https://github.com/monicahq/docker\" \\\\\\n\ + org.opencontainers.image.vendor=\"Monica\" \\\\\\n\ + org.opencontainers.image.version=\"%%VERSION%%\"" apcu_version="$( git ls-remote --tags https://github.com/krakjoe/apcu.git \ @@ -70,6 +72,7 @@ declare -A pecl_versions=( ) version="$(curl -fsSL 'https://api.github.com/repos/monicahq/monica/releases/latest' | jq -r '.tag_name')" +commit="$(curl -fsSL 'https://api.github.com/repos/monicahq/monica/tags' | jq -r 'map(select(.name | contains ("'$version'"))) | .[].commit.sha')" sha512="$(curl -fsSL "https://github.com/monicahq/monica/releases/download/$version/monica-$version.sha512" | grep monica-$version.tar.bz2 | awk '{ print $1 }')" set -x @@ -83,10 +86,11 @@ for variant in apache fpm fpm-alpine; do sed -e ' s/%%VARIANT%%/'"$variant"'/; s/%%PHP_VERSION%%/'"$phpVersion"'/; + s#%%LABEL%%#'"$label"'#; s/%%VERSION%%/'"$version"'/; + s/%%COMMIT%%/'"$commit"'/; s/%%SHA512%%/'"$sha512"'/; s/%%CMD%%/'"${cmd[$variant]}"'/; - s#%%LABEL%%#'"$label"'#; s#%%APACHE_DOCUMENT%%#'"${document[$variant]}"'#; s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/; s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/;