Запуск Dovecot в Doker с Musl
При сборке ни в какую не видит musl-dev, уже отчаялся, какая корректная последовательность? Dockerfile:
FROM alpine:latest as build
ARG vmail_gid
ARG VMAIL_GROUP
ARG VMAIL_USER
ARG vmail_uid
ARG dovecot_tag
ARG dovecot_branch=main
ARG pigeonhole_branch
ARG DOVECOT_PREFIX=/usr/local/dovecot
#
# ARG ACCESS_FIX="/run/dovecot /var/run/dovecot"
#
# build options
ARG dovecot_config="--without-pam \
--without-cdb \
--with-zlib \
--with-bzlib \
--with-storages=maildir \
--without-ldap \
--with-ssl=openssl \
--sysconfdir=/etc \
--prefix=${DOVECOT_PREFIX} \
--with-sql=yes \
--without-sqlite \
--without-apparmor \
--without-mysql \
--with-pgsql \
--without-docs \
--without-libcap \
--without-sql-drivers \
--without-mysql \
--without-sodium \
--without-systemd \
--localstatedir=/var/lib/dovecot \
--enable-dependency-tracking"
ARG pigeonhole_config="--with-dovecot=../dovecot --sysconfdir=/etc --prefix=${DOVECOT_PREFIX} --localstatedir=/var/lib/dovecot \
--with-managesieve=yes \
--with-ldap=no"
RUN apk add musl-dev
RUN addgroup -S -g ${vmail_gid} vmail || export VMAIL_GROUP=root && adduser -S -D -H -u $vmail_uid -G $VMAIL_GROUP -g "Dovecot Vmail" ${VMAIL_USER} && \
set -x && \
apk update && \
apk add --no-cache --virtual .build-deps \
bzip2-dev lz4-dev xz-dev zlib-dev \
runc \
postgresql-dev mariadb-dev sqlite-dev \
openldap-dev \
heimdal-dev \
gnu-libiconv \
linux-headers git automake cmake \
gawk \
g++ \
make \
openldap-dev zlib-dev bzip2-dev autoconf libtool libc-dev gettext gcc bison flex gnutls-dev gettext-dev rpcgen openssl-dev file && \
mkdir -p /opt/dovecot && cd /opt/dovecot && \
git init . && \
git remote add -t ${dovecot_branch} origin https://github.com/dovecot/core && \
git fetch --depth 1 && git checkout ${dovecot_tag} && \
./autogen.sh && \
mkdir -p ${DOVECOT_PREFIX} && \
PANDOC=false ./configure ${dovecot_config} ### && \
RUN set -x && \
cd /opt/dovecot && \
make -s -j$(nproc)
RUN set -x && \
cd /opt/dovecot && \
make install && \
mkdir /opt/pigeonhole/ && \
cd /opt/pigeonhole && \
git init . && git remote add -t ${pigeonhole_branch} origin https://github.com/dovecot/pigeonhole.git && \
git fetch --depth=1 && git checkout ${pigeonhole_branch} && ./autogen.sh && \
./configure ${pigeonhole_config} && \
make -s -j$(nproc) && make install && \
### Setup Container for Dovecot
rm -rf /etc/dovecot/* && \
mkdir -p /var/lib/dovecot && \
chown -R ${VMAIL_USER}:${VMAIL_GROUP} /var/mail && \
chown -R ${VMAIL_USER}:${VMAIL_GROUP} /var/lib/dovecot/ ${DOVECOT_PREFIX}
### Networking Configuration
EXPOSE 1143 2525 1024 1587 1993 4190
FROM alpine:latest
ARG vmail_gid
ARG VMAIL_GROUP
ARG VMAIL_USER
ARG vmail_uid
COPY --from=build /usr/local/dovecot /usr/local/dovecot
RUN apk update && \
apk add zlib wget \
bzip2 \
lz4 \
rspamd-client \
bzip2-dev lz4-dev xz-dev zlib-dev libpq-dev && \
addgroup -S -g ${vmail_gid} vmail || export VMAIL_GROUP=root && adduser -S -D -H -u $vmail_uid -G $VMAIL_GROUP -g "Dovecot Vmail" ${VMAIL_USER} && \
mkdir -p /var/lib/dovecot && \
mkdir -p /etc/dovecot && \
mkdir -p /var/run/dovecot && \
chown -R ${VMAIL_USER}:${VMAIL_GROUP} /var/lib/dovecot/ /var/run/dovecot/ ${DOVECOT_PREFIX} && \
chown -R ${VMAIL_USER}:${VMAIL_GROUP} /etc/dovecot && \
chmod u+x /usr/local/dovecot/libexec/dovecot/dovecot-lda && \
adduser vmail mem
USER ${VMAIL_USER}
CMD ["/usr/local/dovecot/sbin/dovecot", "-F"]
# CMD ["/bin/sh"]
ошибка:
> [dovecot build 4/4] RUN set -x && cd /opt/dovecot && make install && mkdir /opt/pigeonhole/ && cd /opt/pigeonhole && git init . && git remote add -t release-0.5.20 origin https://github.com/dovecot/pigeonhole.git && git fetch --depth=1 && git checkout release-0.5.20 && ./autogen.sh && ./configure --with-dovecot=../dovecot --sysconfdir=/etc --prefix=/usr/local/dovecot --localstatedir=/var/lib/dovecot --with-managesieve=yes --with-ldap=no && make -s -j$(nproc) && make install && rm -rf /etc/dovecot/* && mkdir -p /var/lib/dovecot && chown -R vmail:vmail /var/mail && chown -R vmail:vmail /var/lib/dovecot/ /usr/local/dovecot:
#0 0.466 + cd /opt/dovecot
#0 0.467 + make install
#0 0.481 Making install in .
#0 0.489 make[1]: Entering directory '/opt/dovecot'
#0 0.491 GEN dovecot-config
#0 0.506 GEN dovecot-version.h
#0 0.530 make[2]: Entering directory '/opt/dovecot'
#0 0.530 make install-exec-hook
#0 0.537 make[3]: Entering directory '/opt/dovecot'
#0 0.537 /bin/mkdir -p /usr/local/dovecot/lib/dovecot; \
#0 0.537 grep -v '^LIBDOVECOT_.*_INCLUDE' dovecot-config | \
#0 0.537 grep -v '^LIBDOVECOT.*_DEPS' | sed \
#0 0.537 -e "s|^\(DOVECOT_INSTALLED\)=.*$|\1=yes|" \
#0 0.537 -e "s|^\(LIBDOVECOT\)=.*$|\1='-L/usr/local/dovecot/lib/dovecot -ldovecot'|" \
#0 0.537 -e "s|^\(LIBDOVECOT_LOGIN\)=.*$|\1='-ldovecot-login -lssl -lcrypto'|" \
#0 0.537 -e "s|^\(LIBDOVECOT_SQL\)=.*$|\1=-ldovecot-sql|" \
#0 0.537 -e "s|^\(LIBDOVECOT_LDAP\)=.*$|\1=-ldovecot-ldap|" \
#0 0.537 -e "s|^\(LIBDOVECOT_COMPRESS\)=.*$|\1=-ldovecot-compression|" \
#0 0.537 -e "s|^\(LIBDOVECOT_DSYNC\)=.*$|\1=-ldovecot-dsync|" \
#0 0.537 -e "s|^\(LIBDOVECOT_LDA\)=.*$|\1=-ldovecot-lda|" \
#0 0.537 -e "s|^\(LIBDOVECOT_LIBLANG\)=.*$|\1=-ldovecot-language|" \
#0 0.537 -e "s|^\(LIBDOVECOT_LUA\)=.*$|\1=-ldovecot-lua|" \
#0 0.537 -e "s|^\(LIBDOVECOT_STORAGE\)=.*$|\1='-ldovecot-storage '|" \
#0 0.537 -e "s|^\(LIBDOVECOT_OPENSSL\)=.*$|\1=-lssl_iostream_openssl|" \
#0 0.537 -e "s|^\(LIBDOVECOT_INCLUDE\)=.*$|\1=-I/usr/local/dovecot/include/dovecot|" \
#0 0.537 > /usr/local/dovecot/lib/dovecot/dovecot-config
#0 0.545 make[3]: Leaving directory '/opt/dovecot'
#0 0.548 /bin/mkdir -p '/usr/local/dovecot/share/aclocal'
#0 0.551 /usr/bin/install -c -m 644 m4/dovecot.m4 '/usr/local/dovecot/share/aclocal'
#0 0.555 GEN dovecot-version.h
#0 0.570 /bin/mkdir -p '/usr/local/dovecot/include/dovecot'
#0 0.574 /usr/bin/install -c -m 644 dovecot-version.h '/usr/local/dovecot/include/dovecot'
#0 0.585 /bin/mkdir -p '/usr/local/dovecot/include/dovecot'
#0 0.589 /usr/bin/install -c -m 644 config.h '/usr/local/dovecot/include/dovecot'
#0 0.595 make[2]: Leaving directory '/opt/dovecot'
#0 0.596 make[1]: Leaving directory '/opt/dovecot'
#0 0.596 Making install in src
#0 0.602 make[1]: Entering directory '/opt/dovecot/src'
#0 0.611 Making install in lib-test
#0 0.619 make[2]: Entering directory '/opt/dovecot/src/lib-test'
#0 0.619 CC fuzzer.lo
#0 1.146 CC ostream-final-trickle.lo
#0 1.711 CC test-common.lo
#0 2.901 CC test-istream.lo
#0 3.529 CC test-ostream.lo
#0 4.147 CC test-subprocess.lo
#0 5.391 CCLD libtest.la
#0 5.571 make[3]: Entering directory '/opt/dovecot/src/lib-test'
#0 5.571 make[3]: Nothing to be done for 'install-exec-am'.
#0 5.574 /bin/mkdir -p '/usr/local/dovecot/include/dovecot'
#0 5.578 /usr/bin/install -c -m 644 fuzzer.h ostream-final-trickle.h test-common.h test-subprocess.h '/usr/local/dovecot/include/dovecot'
#0 5.582 make[3]: Leaving directory '/opt/dovecot/src/lib-test'
#0 5.583 make[2]: Leaving directory '/opt/dovecot/src/lib-test'
#0 5.584 Making install in lib
#0 5.616 make[2]: Entering directory '/opt/dovecot/src/lib'
#0 5.803 Connecting to dovecot.org (94.237.105.223:443)
#0 6.108 saving to 'UnicodeData.txt'
#0 6.164 UnicodeData.txt 1% | | 32085 0:01:06 ETA
#0 6.411 UnicodeData.txt 100% |********************************| 2124k 0:00:00 ETA
#0 6.411 'UnicodeData.txt' saved
#0 6.416 GEN unicodemap.c
#0 7.114 GEN event-filter-lexer.c
#0 7.141 GEN event-filter-parser.c
#0 7.323 make install-am
#0 7.350 make[3]: Entering directory '/opt/dovecot/src/lib'
#0 7.351 CC test_lib-test-lib.o
#0 7.485 CC test_lib-test-array.o
#0 8.414 CC test_lib-test-aqueue.o
#0 8.632 CC test_lib-test-backtrace.o
#0 8.777 CC test_lib-test-base32.o
#0 9.079 CC test_lib-test-base64.o
#0 9.968 CC test_lib-test-bits.o
#0 10.47 CC test_lib-test-bsearch-insert-pos.o
#0 10.64 CC test_lib-test-buffer.o
#0 11.23 CC test_lib-test-buffer-istream.o
#0 11.52 CC test_lib-test-byteorder.o
#0 11.92 CC test_lib-test-connection.o
#0 12.65 CC test_lib-test-crc32.o
#0 12.77 CC test_lib-test-cpu-limit.o
#0 13.01 CC test_lib-test-data-stack.o
#0 13.63 CC test_lib-test-env-util.o
#0 13.86 CC test_lib-test-event-category-register.o
#0 14.12 CC test_lib-test-event-filter.o
#0 15.25 CC test_lib-test-event-filter-expr.o
#0 15.61 CC test_lib-test-event-filter-merge.o
#0 15.80 CC test_lib-test-event-filter-parser.o
#0 16.19 CC test_lib-test-event-flatten.o
#0 16.49 CC test_lib-test-event-log.o
#0 20.58 CC test_lib-test-failures.o
#0 20.81 CC test_lib-test-fd-util.o
#0 20.92 CC test_lib-test-file-cache.o
#0 21.43 CC test_lib-test-file-create-locked.o
#0 21.66 CC test_lib-test-guid.o
#0 22.13 CC test_lib-test-hash.o
#0 22.32 CC test_lib-test-hash-format.o
#0 22.46 CC test_lib-test-hash-method.o
#0 22.72 CC test_lib-test-hmac.o
#0 22.99 CC test_lib-test-hex-binary.o
#0 23.18 CC test_lib-test-imem.o
#0 23.36 CC test_lib-test-ioloop.o
#0 23.74 CC test_lib-test-iso8601-date.o
#0 23.89 CC test_lib-test-iostream-pump.o
#0 24.26 CC test_lib-test-iostream-proxy.o
#0 24.46 CC test_lib-test-iostream-temp.o
#0 24.71 CC test_lib-test-istream.o
#0 25.14 CC test_lib-test-istream-base64-decoder.o
#0 25.44 CC test_lib-test-istream-base64-encoder.o
#0 25.66 CC test_lib-test-istream-chain.o
#0 25.94 CC test_lib-test-istream-concat.o
#0 26.38 CC test_lib-test-istream-crlf.o
#0 26.64 CC test_lib-test-istream-failure-at.o
#0 26.80 CC test_lib-test-istream-multiplex.o
#0 27.30 CC test_lib-test-istream-noop.o
#0 27.44 CC test_lib-test-istream-seekable.o
#0 27.87 CC test_lib-test-istream-sized.o
#0 28.15 CC test_lib-test-istream-tee.o
#0 28.48 CC test_lib-test-istream-try.o
#0 28.78 CC test_lib-test-istream-unix.o
#0 29.11 CC test_lib-test-lib-event.o
#0 29.39 CC test_lib-test-lib-signals.o
#0 29.65 CC test_lib-test-llist.o
#0 30.00 CC test_lib-test-log-throttle.o
#0 30.16 CC test_lib-test-macros.o
#0 30.28 CC test_lib-test-malloc-overflow.o
#0 30.45 CC test_lib-test-memarea.o
#0 30.61 CC test_lib-test-mempool.o
#0 30.83 CC test_lib-test-mempool-allocfree.o
#0 31.22 CC test_lib-test-mempool-alloconly.o
#0 31.46 CC test_lib-test-pkcs5.o
#0 31.59 CC test_lib-test-net.o
#0 32.04 CC test_lib-test-numpack.o
#0 32.19 CC test_lib-test-ostream-buffer.o
#0 32.50 CC test_lib-test-ostream-failure-at.o
#0 32.73 CC test_lib-test-ostream-file.o
#0 33.16 CC test_lib-test-ostream-multiplex.o
#0 33.70 CC test_lib-test-multiplex.o
#0 33.96 CC test_lib-test-path-util.o
#0 34.40 CC test_lib-test-primes.o
#0 34.54 CC test_lib-test-printf-format-fix.o
#0 34.78 CC test_lib-test-priorityq.o
#0 35.06 CC test_lib-test-punycode.o
#0 35.21 CC test_lib-test-random.o
#0 35.41 CC test_lib-test-seq-range-array.o
#0 36.20 CC test_lib-test-seq-set-builder.o
#0 36.53 CC test_lib-test-stats-dist.o
#0 36.85 CC test_lib-test-str.o
#0 37.19 CC test_lib-test-strescape.o
#0 37.50 CC test_lib-test-strfuncs.o
#0 38.75 CC test_lib-test-strnum.o
#0 39.45 CC test_lib-test-str-find.o
#0 39.66 CC test_lib-test-str-sanitize.o
#0 39.87 CC test_lib-test-str-parse.o
#0 40.13 CC test_lib-test-str-table.o
#0 40.26 CC test_lib-test-time-util.o
#0 40.74 CC test_lib-test-unichar.o
#0 41.05 CC test_lib-test-utc-mktime.o
#0 41.20 CC test_lib-test-uri.o
#0 41.86 CC test_lib-test-wildcard-match.o
#0 42.05 CC array.lo
#0 42.98 CC aqueue.lo
#0 43.57 CC askpass.lo
#0 43.96 CC backtrace-string.lo
#0 44.29 CC base32.lo
#0 45.26 CC base64.lo
#0 47.45 CC bits.lo
#0 47.86 CC bsearch-insert-pos.lo
#0 48.35 CC buffer.lo
#0 49.88 CC buffer-istream.lo
#0 50.35 CC child-wait.lo
#0 50.96 CC connection.lo
#0 53.37 CC cpu-count.lo
#0 53.51 cpu-count.c: In function 'cpu_count_get':
#0 53.51 cpu-count.c:16:9: error: unknown type name 'cpu_set_t'
#0 53.51 16 | cpu_set_t cs;
#0 53.51 | ^~~~~~~~~
#0 53.51 cpu-count.c:17:9: error: implicit declaration of function 'CPU_ZERO' [-Wimplicit-function-declaration]
#0 53.51 17 | CPU_ZERO(&cs);
#0 53.51 | ^~~~~~~~
#0 53.51 cpu-count.c:18:13: error: implicit declaration of function 'sched_getaffinity' [-Wimplicit-function-declaration]
#0 53.51 18 | if (sched_getaffinity(0, sizeof(cs), &cs) < 0) {
#0 53.51 | ^~~~~~~~~~~~~~~~~
#0 53.52 cpu-count.c:22:18: error: implicit declaration of function 'CPU_COUNT'; did you mean 'CPU_COUNT_H'? [-Wimplicit-function-declaration]
#0 53.52 22 | result = CPU_COUNT(&cs);
#0 53.52 | ^~~~~~~~~
#0 53.52 | CPU_COUNT_H
#0 53.52 make[3]: *** [Makefile:1609: cpu-count.lo] Error 1
#0 53.52 make[3]: Leaving directory '/opt/dovecot/src/lib'
#0 53.52 make[2]: *** [Makefile:3038: install] Error 2
#0 53.52 make[2]: Leaving directory '/opt/dovecot/src/lib'
#0 53.53 make[1]: *** [Makefile:594: install-recursive] Error 1
#0 53.53 make[1]: Leaving directory '/opt/dovecot/src'
#0 53.53 make: *** [Makefile:732: install-recursive] Error 1
------
failed to solve: process "/bin/sh -c set -x && cd /opt/dovecot && make install && mkdir /opt/pigeonhole/ && cd /opt/pigeonhole && git init . && git remote add -t ${pigeonhole_branch} origin https://github.com/dovecot/pigeonhole.git && git fetch --depth=1 && git checkout ${pigeonhole_branch} && ./autogen.sh && ./configure ${pigeonhole_config} && make -s -j$(nproc) && make install && rm -rf /etc/dovecot/* && mkdir -p /var/lib/dovecot && chown -R ${VMAIL_USER}:${VMAIL_GROUP} /var/mail && chown -R ${VMAIL_USER}:${VMAIL_GROUP} /var/lib/dovecot/ ${DOVECOT_PREFIX}" did not complete successfully: exit code: 2
Пробовал вставлять musl-dev в разные блоки RUN, никакого эффекта