mirror of
https://github.com/bokysan/docker-postfix.git
synced 2024-09-20 06:46:10 +08:00
Upd: Fix integration tests with the latest refactor
This commit is contained in:
parent
a6d10e6a13
commit
3385de7fca
|
@ -6,8 +6,8 @@ ARG BASE_IMAGE=alpine:latest
|
|||
FROM ${BASE_IMAGE} AS build-scripts
|
||||
COPY ./build-scripts ./build-scripts
|
||||
|
||||
FROM ${BASE_IMAGE} AS base
|
||||
# ============================ INSTALL BASIC SERVICES ============================
|
||||
FROM ${BASE_IMAGE} AS base
|
||||
|
||||
# Install supervisor, postfix
|
||||
# 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 \
|
||||
sh /build-scripts/postfix-install.sh
|
||||
|
||||
FROM base AS sasl
|
||||
# ============================ BUILD SASL XOAUTH2 ============================
|
||||
FROM base AS sasl
|
||||
|
||||
ARG SASL_XOAUTH2_REPO_URL=https://github.com/tarickb/sasl-xoauth2.git
|
||||
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 \
|
||||
sh /build-scripts/sasl-build.sh
|
||||
|
||||
# ============================ Prepare main image ============================
|
||||
FROM sasl
|
||||
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 BUILDKIT_PROGRESS=plain
|
||||
|
||||
declare cache_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/cache"
|
||||
declare cache_dir
|
||||
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
|
||||
docker buildx create --name multiarch
|
||||
|
@ -22,17 +29,16 @@ if [[ "$*" == *--push* ]]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
arg_list=" --cache-to type=local,dest=${cache_dir}"
|
||||
if [[ -f "${cache_dir}/index.json" ]]; then
|
||||
arg_list="$arg_list --cache-from type=local,src=${cache_dir}"
|
||||
arg_list=" --cache-to type=local,dest=${cache_to}"
|
||||
if [[ -f "${cache_form}/index.json" ]]; then
|
||||
arg_list="$arg_list --cache-from type=local,src=${cache_form}"
|
||||
else
|
||||
mkdir -p "${cache_dir}"
|
||||
mkdir -p "${cache_form}"
|
||||
fi
|
||||
|
||||
#if [[ -z "$PLATFORMS" ]]; then
|
||||
# arg_list="$arg_list --platforms linux/amd64,linux/arm64,linux/arm/v7"
|
||||
#fi
|
||||
|
||||
if [[ -z "$PLATFORMS" ]]; then
|
||||
PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7"
|
||||
fi
|
||||
|
||||
docker buildx build ${arg_list} --platform $PLATFORMS . $*
|
||||
docker buildx build ${arg_list} . $*
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
./build.sh --load --tag boky/postfix
|
||||
cd integration-tests
|
||||
|
||||
FIND="$(which find)"
|
||||
|
|
|
@ -3,8 +3,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
|
@ -3,8 +3,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
|
@ -3,8 +3,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
|
@ -3,8 +3,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
|
@ -3,8 +3,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
|
@ -3,8 +3,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
|
@ -7,8 +7,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
|
@ -6,8 +6,6 @@ services:
|
|||
postfix_test_587:
|
||||
hostname: "postfix"
|
||||
image: "boky/postfix"
|
||||
build:
|
||||
context: ../..
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
|
||||
|
|
Loading…
Reference in a new issue