logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 12b28c8925c2c55e0d7bb66ff3320532a1aade3b
parent: a431e8c9f7033c739e10b0e8b34c75f2cc1d38d4
Author: lain <lain@soykaf.club>
Date:   Mon, 13 Jan 2020 15:25:41 +0000

Merge branch 'feature/ci-registry' into 'develop'

Update Dockerfile with labels. Update gitlab-ci for registry usage

See merge request pleroma/pleroma!2098

Diffstat:

M.gitlab-ci.yml27+++++++++++++++++++++++++--
MDockerfile14++++++++++++++
2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -6,18 +6,24 @@ variables: &global_variables POSTGRES_PASSWORD: postgres DB_HOST: postgres MIX_ENV: test + DOCKER_DRIVER: overlay2 + DOCKER_HOST: unix:///var/run/docker.sock + DOCKER_IMAGE: $CI_REGISTRY_IMAGE:latest + DOCKER_IMAGE_SHA: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA cache: &global_cache_policy key: ${CI_COMMIT_REF_SLUG} paths: - - deps - - _build + - deps + - _build + stages: - build - test - benchmark - deploy - release + - docker before_script: - mix local.hex --force @@ -264,3 +270,20 @@ arm64-musl: variables: *release-variables before_script: *before-release-musl script: *release + +docker: + stage: docker + image: docker:latest + tags: + - dind + before_script: &before-docker + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - export CI_JOB_TIMESTAMP=$(date --utc -Iseconds) + - export CI_VCS_REF=$CI_COMMIT_SHORT_SHA + script: + - docker pull $DOCKER_IMAGE || true + - docker build --cache-from $DOCKER_IMAGE --build-arg VCS_REF=$CI_VCS_REF --build-arg BUILD_DATE=$CI_JOB_TIMESTAMP -t $DOCKER_IMAGE_SHA -t $DOCKER_IMAGE . + - docker push $DOCKER_IMAGE_SHA + - docker push $DOCKER_IMAGE + only: + - develop diff --git a/Dockerfile b/Dockerfile @@ -14,6 +14,20 @@ RUN apk add git gcc g++ musl-dev make &&\ FROM alpine:3.9 +ARG BUILD_DATE +ARG VCS_REF + +LABEL maintainer="ops@pleroma.social" \ + org.opencontainers.image.title="pleroma" \ + org.opencontainers.image.description="Pleroma for Docker" \ + org.opencontainers.image.authors="ops@pleroma.social" \ + org.opencontainers.image.vendor="pleroma.social" \ + org.opencontainers.image.documentation="https://git.pleroma.social/pleroma/pleroma" \ + org.opencontainers.image.licenses="AGPL-3.0" \ + org.opencontainers.image.url="https://pleroma.social" \ + org.opencontainers.image.revision=$VCS_REF \ + org.opencontainers.image.created=$BUILD_DATE + ARG HOME=/opt/pleroma ARG DATA=/var/lib/pleroma