feat(arm64): build arm64 image using compiled bins

both dovecot and pigeonhole is compiled in ci pipeline

!10
This commit is contained in:
2023-05-21 11:49:50 +09:30
parent 676546f71c
commit a866bd82b8
2 changed files with 16 additions and 1 deletions

View File

@ -10,6 +10,7 @@ include:
variables:
DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/arm64"
DOCKER_IMAGE_PUBLISH_NAME: 'docker-mail'
DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing
DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME

View File

@ -15,6 +15,7 @@ ARG CI_JOB_TOKEN
ARG CI_API_V4_URL
ARG CI_PROJECT_ID
ARG DOVECOT_BUILD_VERSION
ARG PIGEONHOLE_BUILD_VERSION
ARG VERSION_APT_DOVECOT
LABEL \
@ -95,10 +96,23 @@ RUN apt update && apt -y --no-install-recommends install \
dovecot-ldap=$VERSION_APT_DOVECOT \
dovecot-sieve=$VERSION_APT_DOVECOT \
dovecot-managesieved=$VERSION_APT_DOVECOT; \
else \
# as this architecture doesn't exist in the apt repo, use compiled versions
adduser --system --group dovecot --no-create-home; \
cd tmp; \
curl --user "JOB-TOKEN: ${CI_JOB_TOKEN}" \
"https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/generic/dovecot/${DOVECOT_BUILD_VERSION}/dovecot-core_${DOVECOT_BUILD_VERSION}-1_$(echo `dpkg --print-architecture`).deb" -o "dovecot-core_${DOVECOT_BUILD_VERSION}-1_$(echo `dpkg --print-architecture`).deb"; \
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \
"https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/generic/dovecot/${DOVECOT_BUILD_VERSION}/dovecot-pigeonhole_${DOVECOT_BUILD_VERSION}-1_$(echo `dpkg --print-architecture`).deb" -o "dovecot-pigeonhole_${DOVECOT_BUILD_VERSION}-1_$(echo `dpkg --print-architecture`).deb"; \
dpkg -i dovecot-core_${DOVECOT_BUILD_VERSION}-1_$(echo `dpkg --print-architecture`).deb; \
cp /usr/local/share/doc/dovecot/example-config/dovecot.conf /etc/dovecot/; \
dpkg -i dovecot-core_$DOVECOT_BUILD_VERSION-1_$(echo `dpkg --print-architecture`).deb; \
fi
# Cleanup, remove cron jobs not required
RUN rm -f /etc/cron.d/e2scrub_all \
&& rm -f /etc/cron.daily/apt-compat \