mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Provide version information through labels (#1256)
* Provide version information through labels Can be retrieved by calling e.g. `docker inspect -f {{.Config.Labels}} tvial/docker-mailserver:testing` Signed-off-by: Felix Bartels <felix@host-consultants.de> * add build hook so that Docker Hub can work with the build args Signed-off-by: Felix Bartels <felix@host-consultants.de> * remove obsolete build-no-cache build args invalidate build cache already Signed-off-by: Felix Bartels <felix@host-consultants.de> * adapt travis file Signed-off-by: Felix Bartels <felix@host-consultants.de> * shellcheck Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
parent
1029777ffa
commit
7ff9764285
|
@ -13,7 +13,7 @@ before_install:
|
||||||
- sudo chmod +rx /usr/local/bin/hadolint
|
- sudo chmod +rx /usr/local/bin/hadolint
|
||||||
install:
|
install:
|
||||||
- make lint
|
- make lint
|
||||||
- travis_retry travis_wait make build-no-cache
|
- travis_retry travis_wait make build
|
||||||
script:
|
script:
|
||||||
- make generate-accounts run generate-accounts-after-run fixtures tests
|
- make generate-accounts run generate-accounts-after-run fixtures tests
|
||||||
after_script:
|
after_script:
|
||||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -1,5 +1,16 @@
|
||||||
FROM debian:stretch-slim
|
FROM debian:stretch-slim
|
||||||
LABEL maintainer="Thomas VIAL"
|
|
||||||
|
ARG VCS_REF
|
||||||
|
ARG VCS_VERSION
|
||||||
|
|
||||||
|
LABEL maintainer="Thomas VIAL" \
|
||||||
|
org.label-schema.name="docker-mailserver" \
|
||||||
|
org.label-schema.description="A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...)" \
|
||||||
|
org.label-schema.url="https://github.com/tomav/docker-mailserver" \
|
||||||
|
org.label-schema.vcs-ref=$VCS_REF \
|
||||||
|
org.label-schema.vcs-url="https://github.com/tomav/docker-mailserver" \
|
||||||
|
org.label-schema.version=$VCS_VERSION \
|
||||||
|
org.label-schema.schema-version="1.0"
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
ENV VIRUSMAILS_DELETE_DELAY=7
|
ENV VIRUSMAILS_DELETE_DELAY=7
|
||||||
|
|
14
Makefile
14
Makefile
|
@ -1,15 +1,15 @@
|
||||||
NAME = tvial/docker-mailserver:testing
|
NAME = tvial/docker-mailserver:testing
|
||||||
|
VCS_REF := $(shell git rev-parse --short HEAD)
|
||||||
|
VCS_VERSION := $(shell git describe)
|
||||||
|
|
||||||
all: build-no-cache backup generate-accounts run generate-accounts-after-run fixtures tests clean
|
all: build backup generate-accounts run generate-accounts-after-run fixtures tests clean
|
||||||
all-fast: build backup generate-accounts run generate-accounts-after-run fixtures tests clean
|
|
||||||
no-build: backup generate-accounts run generate-accounts-after-run fixtures tests clean
|
no-build: backup generate-accounts run generate-accounts-after-run fixtures tests clean
|
||||||
|
|
||||||
build-no-cache:
|
|
||||||
export DOCKER_MAIL_DOCKER_BUILD_NO_CACHE=--no-cache
|
|
||||||
docker build --no-cache -t $(NAME) .
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
docker build -t $(NAME) .
|
docker build \
|
||||||
|
--build-arg VCS_REF=$(VCS_REF) \
|
||||||
|
--build-arg VCS_VERSION=$(VCS_VERSION) \
|
||||||
|
-t $(NAME) .
|
||||||
|
|
||||||
backup:
|
backup:
|
||||||
# if backup directories exist, clean hasn't been called, therefore we shouldn't overwrite it. It still contains the original content.
|
# if backup directories exist, clean hasn't been called, therefore we shouldn't overwrite it. It still contains the original content.
|
||||||
|
|
8
hooks/build
Executable file
8
hooks/build
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
VCS_REF=$(git rev-parse --short HEAD)
|
||||||
|
VCS_VERSION=$(git describe)
|
||||||
|
|
||||||
|
docker build \
|
||||||
|
--build-arg VCS_REF="$VCS_REF" \
|
||||||
|
--build-arg VCS_VERSION="$VCS_VERSION" \
|
||||||
|
-f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .
|
|
@ -10,7 +10,7 @@ function teardown() {
|
||||||
|
|
||||||
function setup_file() {
|
function setup_file() {
|
||||||
pushd test/docker-openldap/
|
pushd test/docker-openldap/
|
||||||
docker build -f Dockerfile -t ldap $DOCKER_MAIL_DOCKER_BUILD_NO_CACHE .
|
docker build -f Dockerfile -t ldap --no-cache .
|
||||||
popd
|
popd
|
||||||
|
|
||||||
docker run -d --name ldap_for_mail \
|
docker run -d --name ldap_for_mail \
|
||||||
|
|
Loading…
Reference in a new issue