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 # 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 ./ COPY package.json ./
RUN npm install RUN npm install
@ -41,5 +43,4 @@ ENV FLASK_APP mailu
CMD /start.py CMD /start.py
HEALTHCHECK CMD curl -f -L http://localhost/ui/login?next=ui.index || exit 1 HEALTHCHECK CMD curl -f -L http://localhost/ui/login?next=ui.index || exit 1

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

@ -1,5 +1,13 @@
ARG PHP_DISTRO=php:7.3-apache ARG ARCH=""
FROM $PHP_DISTRO 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 #Shared layer between rainloop and roundcube
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
python3 curl python3-pip git \ python3 curl python3-pip git \

@ -1,5 +1,10 @@
ARG PHP_DISTRO=php:7.3-apache # NOTE: only add file if building for arm
FROM PHP_DISTRO 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 #Shared layer between rainloop and roundcube
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
python3 curl python3-pip git \ python3 curl python3-pip git \

Loading…
Cancel
Save