Skip to content

Commit

Permalink
Switch to opencontainers label spec
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-ax committed Dec 23, 2023
1 parent ae8c2bc commit d2acdab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
tags: [ 'v*' ]

env:
REPOSITORY_URL: registry.hub.docker.com
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

jobs:
Expand All @@ -15,6 +14,7 @@ jobs:
if: github.event_name == 'push'

env:
REPOSITORY_URL: registry.hub.docker.com
IMAGE_NAME: alerta/alerta-web

steps:
Expand All @@ -23,9 +23,9 @@ jobs:
id: docker-build
run: >-
docker build
--build-arg VCS_REF=${{ github.sha }}
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
--build-arg VERSION=$(cat VERSION)
--build-arg RELEASE=$(cat VERSION)
--build-arg VERSION=${{ github.sha }}
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:$(cat VERSION)
-t $REPOSITORY_URL/$IMAGE_NAME:$(git rev-parse --short HEAD)
Expand Down
19 changes: 10 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ENV PYTHONUNBUFFERED 1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1

ARG BUILD_DATE=now
ARG VCS_REF
ARG BUILD_DATE
ARG RELEASE
ARG VERSION

ENV SERVER_VERSION=${VERSION}
Expand All @@ -25,13 +25,13 @@ ENV HEARTBEAT_SEVERITY=major
ENV HK_EXPIRED_DELETE_HRS=2
ENV HK_INFO_DELETE_HRS=12

LABEL maintainer="Nick Satterly <[email protected]>"
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.url="https://alerta.io" \
org.label-schema.vcs-url="https://github.com/alerta/docker-alerta" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0.0-rc.1"
LABEL org.opencontainers.image.description="Alerta API (prod)" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.url="https://github.com/alerta/alerta/pkgs/container/alerta-api" \
org.opencontainers.image.source="https://github.com/alerta/alerta" \
org.opencontainers.image.version=$RELEASE \
org.opencontainers.image.revision=$VERSION \
org.opencontainers.image.licenses=Apache-2.0

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down Expand Up @@ -73,6 +73,7 @@ RUN curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -
rm -rf /var/lib/apt/lists/*

COPY requirements*.txt /app/

# hadolint ignore=DL3013
RUN pip install --no-cache-dir pip virtualenv jinja2 && \
python3 -m venv /venv && \
Expand Down

0 comments on commit d2acdab

Please sign in to comment.