Docker build for ARM (Raspberry Pi) (#2436)
* Docker build for ARM (Raspberry Pi) Inspired by https://github.com/stas-demydiuk/domoticz-docker * Execution rights * Readme typo * Move QEMU higher up * Change tar command * Try to fix COPY error * Fix path bugpull/2438/head
parent
68cc039bc7
commit
dcb090dcd7
3 changed files with 61 additions and 2 deletions
@ -0,0 +1,46 @@ |
||||
# Only relevant for Docker Hub or QEMU multi-architecture builds. |
||||
# Prefer the normal `Dockerfile` if you are building manually on the targeted architecture. |
||||
|
||||
FROM arm32v7/ubuntu:19.04 |
||||
|
||||
# Requires ./hooks/* |
||||
COPY ./Docker/qemu-* /usr/bin/ |
||||
|
||||
ENV TZ UTC |
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
||||
|
||||
RUN apt update && \ |
||||
apt install --no-install-recommends -y \ |
||||
ca-certificates cron \ |
||||
apache2 libapache2-mod-php \ |
||||
php-curl php-intl php-mbstring php-xml php-zip \ |
||||
php-sqlite3 php-mysql php-pgsql && \ |
||||
rm -rf /var/lib/apt/lists/* |
||||
|
||||
RUN mkdir -p /var/www/FreshRSS/ /run/apache2/ |
||||
WORKDIR /var/www/FreshRSS |
||||
|
||||
COPY . /var/www/FreshRSS |
||||
COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/ |
||||
|
||||
RUN a2dismod -f alias autoindex negotiation status && \ |
||||
a2enmod deflate expires headers mime setenvif && \ |
||||
a2disconf '*' && \ |
||||
a2dissite '*' && \ |
||||
a2ensite 'FreshRSS*' |
||||
|
||||
RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \ |
||||
sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \ |
||||
touch /var/www/FreshRSS/Docker/env.txt && \ |
||||
echo "17,47 * * * * . /var/www/FreshRSS/Docker/env.txt; \ |
||||
su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ |
||||
2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - |
||||
|
||||
ENV COPY_SYSLOG_TO_STDERR On |
||||
ENV CRON_MIN '' |
||||
ENTRYPOINT ["./Docker/entrypoint.sh"] |
||||
|
||||
EXPOSE 80 |
||||
CMD ([ -z "$CRON_MIN" ] || cron) && \ |
||||
. /etc/apache2/envvars && \ |
||||
exec apache2 -D FOREGROUND |
@ -0,0 +1,12 @@ |
||||
#!/bin/bash |
||||
|
||||
if [[ "$DOCKERFILE_PATH" == *-ARM ]]; |
||||
then |
||||
# https://github.com/balena-io/qemu |
||||
# Download a local copy of QEMU on Docker Hub build machine |
||||
curl -LSs 'https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz' | tar -xzv --strip-components=1 --wildcards '*/qemu-*' |
||||
|
||||
# https://github.com/multiarch/qemu-user-static |
||||
# Register qemu-*-static for all supported processors except the current one, but also remove all registered binfmt_misc before |
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset |
||||
fi |
Loading…
Reference in new issue