mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-06 06:25:40 +08:00
Upd: Fix integration tests with the latest refactor
This commit is contained in:
parent
a6d10e6a13
commit
3385de7fca
11 changed files with 22 additions and 29 deletions
|
@ -6,8 +6,8 @@ ARG BASE_IMAGE=alpine:latest
|
||||||
FROM ${BASE_IMAGE} AS build-scripts
|
FROM ${BASE_IMAGE} AS build-scripts
|
||||||
COPY ./build-scripts ./build-scripts
|
COPY ./build-scripts ./build-scripts
|
||||||
|
|
||||||
FROM ${BASE_IMAGE} AS base
|
|
||||||
# ============================ INSTALL BASIC SERVICES ============================
|
# ============================ INSTALL BASIC SERVICES ============================
|
||||||
|
FROM ${BASE_IMAGE} AS base
|
||||||
|
|
||||||
# Install supervisor, postfix
|
# Install supervisor, postfix
|
||||||
# Install postfix first to get the first account (101)
|
# Install postfix first to get the first account (101)
|
||||||
|
@ -20,8 +20,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
|
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
|
||||||
sh /build-scripts/postfix-install.sh
|
sh /build-scripts/postfix-install.sh
|
||||||
|
|
||||||
FROM base AS sasl
|
|
||||||
# ============================ BUILD SASL XOAUTH2 ============================
|
# ============================ BUILD SASL XOAUTH2 ============================
|
||||||
|
FROM base AS sasl
|
||||||
|
|
||||||
ARG SASL_XOAUTH2_REPO_URL=https://github.com/tarickb/sasl-xoauth2.git
|
ARG SASL_XOAUTH2_REPO_URL=https://github.com/tarickb/sasl-xoauth2.git
|
||||||
ARG SASL_XOAUTH2_GIT_REF=release-0.12
|
ARG SASL_XOAUTH2_GIT_REF=release-0.12
|
||||||
|
@ -36,6 +36,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
|
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
|
||||||
sh /build-scripts/sasl-build.sh
|
sh /build-scripts/sasl-build.sh
|
||||||
|
|
||||||
|
# ============================ Prepare main image ============================
|
||||||
FROM sasl
|
FROM sasl
|
||||||
LABEL maintainer="Bojan Cekrlic - https://github.com/bokysan/docker-postfix/"
|
LABEL maintainer="Bojan Cekrlic - https://github.com/bokysan/docker-postfix/"
|
||||||
|
|
||||||
|
|
28
build.sh
28
build.sh
|
@ -6,9 +6,16 @@ export DOCKER_BUILDKIT=1
|
||||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
export BUILDKIT_PROGRESS=plain
|
export BUILDKIT_PROGRESS=plain
|
||||||
|
|
||||||
declare cache_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/cache"
|
declare cache_dir
|
||||||
declare arg_list
|
declare arg_list
|
||||||
declare PLATFORMS
|
|
||||||
|
if [[ "$CI" == "true" ]]; then
|
||||||
|
cache_form="/tmp/.buildx-cache/alpine"
|
||||||
|
cache_to="/tmp/.buildx-cache-new/alpine"
|
||||||
|
else
|
||||||
|
cache_from="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/cache"
|
||||||
|
cache_to="${cache_from}"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! docker buildx inspect multiarch > /dev/null; then
|
if ! docker buildx inspect multiarch > /dev/null; then
|
||||||
docker buildx create --name multiarch
|
docker buildx create --name multiarch
|
||||||
|
@ -22,17 +29,16 @@ if [[ "$*" == *--push* ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
arg_list=" --cache-to type=local,dest=${cache_dir}"
|
arg_list=" --cache-to type=local,dest=${cache_to}"
|
||||||
if [[ -f "${cache_dir}/index.json" ]]; then
|
if [[ -f "${cache_form}/index.json" ]]; then
|
||||||
arg_list="$arg_list --cache-from type=local,src=${cache_dir}"
|
arg_list="$arg_list --cache-from type=local,src=${cache_form}"
|
||||||
else
|
else
|
||||||
mkdir -p "${cache_dir}"
|
mkdir -p "${cache_form}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#if [[ -z "$PLATFORMS" ]]; then
|
||||||
|
# arg_list="$arg_list --platforms linux/amd64,linux/arm64,linux/arm/v7"
|
||||||
|
#fi
|
||||||
|
|
||||||
if [[ -z "$PLATFORMS" ]]; then
|
docker buildx build ${arg_list} . $*
|
||||||
PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7"
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker buildx build ${arg_list} --platform $PLATFORMS . $*
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
./build.sh --load --tag boky/postfix
|
||||||
cd integration-tests
|
cd integration-tests
|
||||||
|
|
||||||
FIND="$(which find)"
|
FIND="$(which find)"
|
||||||
|
|
|
@ -3,8 +3,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
|
@ -3,8 +3,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
|
@ -3,8 +3,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
|
@ -3,8 +3,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
|
@ -3,8 +3,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
|
@ -3,8 +3,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
|
@ -7,8 +7,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
|
@ -6,8 +6,6 @@ services:
|
||||||
postfix_test_587:
|
postfix_test_587:
|
||||||
hostname: "postfix"
|
hostname: "postfix"
|
||||||
image: "boky/postfix"
|
image: "boky/postfix"
|
||||||
build:
|
|
||||||
context: ../..
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||||
|
|
Loading…
Add table
Reference in a new issue