New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permit raspberry pi (and other architectures) builds #985
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
572a852
script to build arm images
abondis 120b07c
use different alpine image for arm, add config for php images+arm
abondis a053f90
docs: user ARG to chose image, install python3 before running pip3
abondis 3a10865
install python for setup image, accept args for build_arm script
abondis c0f4126
use 3.8 for arm too
abondis b711ef8
use edge for radicale
abondis 199b74a
update comments, add helper script to push local build to rpi
abondis 42e5208
update docs
abondis 7684eda
add changelog
abondis a8f55aa
copy arm qemu
abondis 124b1d4
rebase and update for 3.10, avoid adding qemu file to x86 images
abondis e1a4bf3
only insert qemu binary if building for arm
abondis 3407924
fix ARG positions
abondis 2c95ed9
Delete CHANGELOG.md.20190330
abondis 98307f8
RPi: fix alpine version for setup, only one layer for pip install
abondis 5066129
RPi: update doc (alpine version + variables)
abondis File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ pip-selfcheck.json | |
/docker-compose.yml | ||
/.idea | ||
/.vscode | ||
qemu-arm-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# This is an idle image to dynamically replace any component if disabled. | ||
|
||
FROM alpine:3.10 | ||
ARG DISTRO=alpine:3.10 | ||
FROM $DISTRO | ||
|
||
CMD sleep 1000000d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _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: | ||
|
||
- ``DISTRO``: is the main distro used (ie: alpine:3.8) | ||
- ``PHP_DISTRO``: is used for the ``rainloop`` and ``roundcube`` images | ||
- ``EDGE_DISTRO``: is used for ``radicale`` as edge has dulwich and radicale as packages | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
FROM python:3-alpine | ||
ARG DISTRO=alpine:3.8 | ||
FROM $DISTRO | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN apk add --no-cache curl \ | ||
&& pip install -r requirements.txt | ||
RUN apk add --no-cache curl python3 py3-pip | ||
RUN pip3 install -r requirements.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small notice, this should not be split in two layera. |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep these actions in a single |
||
COPY server.py ./server.py | ||
COPY main.py ./main.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -x | ||
|
||
ALPINE_VER="3.10" | ||
DISTRO="balenalib/rpi-alpine:$ALPINE_VER" | ||
# Used for webmails | ||
muhlemmer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
QEMU="arm" | ||
ARCH="arm32v7/" | ||
|
||
# use qemu-*-static from docker container | ||
docker run --rm --privileged multiarch/qemu-user-static:register | ||
muhlemmer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
docker-compose -f build.yml build \ | ||
--build-arg DISTRO=$DISTRO \ | ||
--build-arg ARCH=$ARCH \ | ||
--build-arg QEMU=$QEMU \ | ||
--parallel $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash -x | ||
# Small script to deploy locally built images to a remote docker | ||
compose_options=$1 | ||
images=$(docker-compose $1 images | awk 'NR > 2 { printf $2":"$3" " }') | ||
docker save $images | pigz - > mail.local.tgz | ||
echo "now run 'docker -H \"ssh://user@host\" load -i mail.local.tgz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add options to support different architectures builds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edge is no longer used:
Mailu/optional/radicale/Dockerfile
Line 1 in 13d6cf2