only insert qemu binary if building for arm

master
Aurélien Bondis 5 years ago
parent 124b1d4c71
commit e1a4bf32a6

@ -1,5 +1,7 @@
# First stage to build assets
FROM node:8 as assets
ARG ARCH=""
FROM ${ARCH}node:8 as assets
COPY --from=balenalib/rpi-alpine:3.10 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
COPY package.json ./
RUN npm install
@ -42,4 +44,3 @@ ENV FLASK_APP mailu
CMD /start.py
HEALTHCHECK CMD curl -f -L http://localhost/ui/login?next=ui.index || exit 1

@ -3,11 +3,13 @@
ALPINE_VER="3.10"
DISTRO="balenalib/rpi-alpine:$ALPINE_VER"
# Used for webmails
PHP="arm32v7/php:7.3-apache"
QEMU="arm"
ARCH="arm32v7/"
# use qemu-*-static from docker container
docker run --rm --privileged multiarch/qemu-user-static:register
docker-compose -f build.yml build \
--build-arg DISTRO=$DISTRO \
--build-arg PHP_DISTRO=$PHP \
--build-arg ARCH=$ARCH \
--build-arg QEMU=$QEMU \
--parallel $@

@ -1,5 +1,13 @@
ARG PHP_DISTRO=php:7.3-apache
FROM $PHP_DISTRO
ARG ARCH=""
ARG QEMU=other
# NOTE: only add file if building for arm
FROM ${ARCH}php:7.3-apache as build_arm
ONBUILD COPY --from=balenalib/rpi-alpine:3.10 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
FROM ${ARCH}php:7.3-apache as build_other
FROM build_${QEMU}
#Shared layer between rainloop and roundcube
RUN apt-get update && apt-get install -y \
python3 curl python3-pip git \

@ -1,5 +1,10 @@
ARG PHP_DISTRO=php:7.3-apache
FROM PHP_DISTRO
# NOTE: only add file if building for arm
FROM ${ARCH}php:7.3-apache as build_arm
ONBUILD COPY --from=balenalib/rpi-alpine:3.10 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
FROM ${ARCH}php:7.3-apache as build_other
FROM build_${QEMU}
#Shared layer between rainloop and roundcube
RUN apt-get update && apt-get install -y \
python3 curl python3-pip git \

Loading…
Cancel
Save