1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-11-23 22:04:47 +02:00
985: Permit raspberry pi (and other architectures) builds r=mergify[bot] a=abondis

## What type of PR?

Enhancement

## What does this PR do?

Add an option to select base images and permit building for different CPU architectures.

### Related issue(s)
N/A

## Prerequistes

- [X] documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/guide.html#changelog) entry file.


Co-authored-by: Aurélien Bondis <aurelien.bondis@gmail.com>
Co-authored-by: Aurelien <aurelien.bondis@gmail.com>
This commit is contained in:
bors[bot]
2019-10-20 20:41:03 +00:00
committed by GitHub
21 changed files with 104 additions and 27 deletions

View File

@@ -1,12 +1,13 @@
FROM python:3-alpine
ARG DISTRO=alpine:3.8
FROM $DISTRO
COPY requirements.txt /requirements.txt
ARG version=master
ENV VERSION=$version
RUN pip install -r /requirements.txt \
&& apk add --no-cache nginx curl \
RUN apk add --no-cache nginx curl python3 \
&& pip3 install -r /requirements.txt \
&& mkdir /run/nginx
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

25
docs/rpi_build.rst Normal file
View File

@@ -0,0 +1,25 @@
.. _rpi_build:
Building for a Raspberry Pi
===========================
The build does not need to be done on the Pi.
To do so, go to ``tests/`` and call ``./build_arm.sh``, it will build all
necessary images for arm.
To push the locally built images to a remote server, run ``./deploy_to_pi.sh``.
Docker 18.09+ is needed to use ``-H ssh://<user>@<host>``.
Adjustments
-----------
``build_arm.sh`` uses some variables passed as ``build-arg`` to docker-compose:
- ``ALPINE_VER``: version of ALPINE to use
- ``DISTRO``: is the main distro used. Dockerfiles are set on Alpine 3.10, and
build script overrides for ``balenalib/rpi-alpine:3.10``
- ``QEMU``: Used by webmails dockerfiles. It will add ``qemu-arm-static`` only
if ``QEMU`` is set to ``arm``
- ``ARCH``: Architecture to use for ``admin``, and ``webmails`` as their images
are available for those architectures.

View File

@@ -19,9 +19,7 @@ Prepare the environment
Mailu images are designed to work on x86 or equivalent hardware, so it
should run on pretty much any cloud server as long as enough power is
provided. If you find yourself running Mailu on small hardware, e.g.
Raspberry Pi or other platforms based on ARM, you will probably find
some support from `MFAshby's fork`_.
provided. For non x86 machines, see :ref:`rpi_build`
You are free to choose any operating system that runs Docker (>= 1.11),
then chose between various flavors including Docker Compose, Kubernetes
@@ -34,7 +32,6 @@ You should also have at least a DNS hostname and a DNS name for receiving
emails. Some instructions are provided on the matter in the article
:ref:`dns_setup`.
.. _`MFAshby's fork`: https://github.com/MFAshby/Mailu
Pick a Mailu version
--------------------