Skip to content

Firefly III: a personal finances manager

Let's see what ARM 64 will do.

James Colec4256dd25be7
diff --git a/.deploy/docker/build-amd64.sh b/.deploy/docker/build-amd64.sh
index 3d8cd8f31a..c14c6472b2 100755
--- a/.deploy/docker/build-amd64.sh
+++ b/.deploy/docker/build-amd64.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# build image
+# First build AMD64 image:
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
if [ "$TRAVIS_BRANCH" == "develop" ]; then
@@ -17,4 +17,34 @@ if [ "$TRAVIS_BRANCH" == "master" ]; then
docker tag jc5x/firefly-iii:latest-amd64 jc5x/firefly-iii:release-$VERSION-amd64
docker push jc5x/firefly-iii:latest-amd64
docker push jc5x/firefly-iii:release-$VERSION-amd64
+fi
+
+# Then build ARM image (not 64 bits)
+
+docker run --rm --privileged multiarch/qemu-user-static:register --reset
+
+# get qemu-arm-static binary
+mkdir tmp
+pushd tmp && \
+curl -L -o qemu-arm-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/v2.6.0/qemu-arm-static.tar.gz && \
+tar xzf qemu-arm-static.tar.gz && \
+popd
+
+# build image
+echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
+
+if [ "$TRAVIS_BRANCH" == "develop" ]; then
+ echo "Build develop arm"
+ docker build --tag jc5x/firefly-iii:develop-arm --file Dockerfile.arm .
+ docker tag jc5x/firefly-iii:develop-arm jc5x/firefly-iii:develop-$VERSION-arm
+ docker push jc5x/firefly-iii:develop-arm
+ docker push jc5x/firefly-iii:develop-$VERSION-arm
+fi
+
+if [ "$TRAVIS_BRANCH" == "master" ]; then
+ echo "Build master arm"
+ docker build --tag jc5x/firefly-iii:latest-arm --file Dockerfile.arm .
+ docker tag jc5x/firefly-iii:latest-arm jc5x/firefly-iii:release-$VERSION-arm
+ docker push jc5x/firefly-iii:latest-arm
+ docker push jc5x/firefly-iii:release-$VERSION-arm
fi
\ No newline at end of file
diff --git a/.deploy/docker/build-arm64.sh b/.deploy/docker/build-arm64.sh
new file mode 100755
index 0000000000..36434fcbf6
--- /dev/null
+++ b/.deploy/docker/build-arm64.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
+
+if [ "$TRAVIS_BRANCH" == "develop" ]; then
+ echo "Build develop arm64"
+ docker build -t jc5x/firefly-iii:develop-arm64 -f Dockerfile.arm64 .
+ docker tag jc5x/firefly-iii:develop-arm64 jc5x/firefly-iii:develop-$VERSION-arm64
+ docker push jc5x/firefly-iii:develop-arm64
+ docker push jc5x/firefly-iii:develop-$VERSION-arm64
+fi
+
+if [ "$TRAVIS_BRANCH" == "master" ]; then
+ echo "Build master arm64"
+ docker build -t jc5x/firefly-iii:latest-arm64 -f Dockerfile.arm64 .
+ docker tag jc5x/firefly-iii:latest-arm64 jc5x/firefly-iii:release-$VERSION-arm64
+ docker push jc5x/firefly-iii:latest-arm64
+ docker push jc5x/firefly-iii:release-$VERSION-arm64
+fi
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 5de47bdf62..2a3a63433f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,13 +14,14 @@ jobs:
include:
- dist: xenial
arch: amd64
- env: ARCH_VERS=amd64 VERSION=4.8.1.8
+ env: ARCH=amd64 VERSION=4.8.1.8
- dist: xenial
arch: arm64
- env: ARCH_VERS=arm64 VERSION=4.8.1.8
+ env: ARCH=arm64 VERSION=4.8.1.8
script:
# - .deploy/docker/travis.sh
# enable experimental features.
- echo $TRAVIS_DIST
- - echo $ARCH_VERS
\ No newline at end of file
+ - echo $ARCH_VERS
+ - .deploy/docker/build-$ARCH.sh
\ No newline at end of file
diff --git a/Dockerfile.amd64 b/Dockerfile.amd64
index 15d23bb68f..99c593b670 100644
--- a/Dockerfile.amd64
+++ b/Dockerfile.amd64
@@ -1,4 +1,33 @@
-FROM jc5x/firefly-iii-base-image:latest
+FROM arm64v8/php:7.3-apache-stretch
+ENV COMPOSER_ALLOW_SUPERUSER=1
+
+# Install stuff Firefly III runs with & depends on: php extensions, locales, dev headers and composer
+RUN apt-get update && apt-get install -y locales unzip && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+# Script to run common extensions
+ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/
+
+RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \
+ install-php-extensions --cleanup bcmath ldap gd pdo_pgsql pdo_sqlite pdo_mysql intl opcache memcached
+
+# common config
+RUN a2enmod rewrite && a2enmod ssl && \
+ echo "el_GR.UTF-8 UTF-8\nhu_HU.UTF-8 UTF-8\nro_RO.UTF-8 UTF-8\nnb_NO.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8\ncs_CZ.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\nzh_TW.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n\n" > /etc/locale.gen && \
+ locale-gen && \
+ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
+ composer global require hirak/prestissimo --no-plugins --no-scripts && \
+ cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
+ sed -i 's/max_execution_time = 30/max_execution_time = 600/' /usr/local/etc/php/php.ini && \
+ sed -i 's/memory_limit = 128M/memory_limit = 512M/' /usr/local/etc/php/php.ini
+
+# copy ca certs to correct location
+COPY ./cacert.pem /usr/local/ssl/cert.pem
+
+# copy Apache config to correct spot.
+COPY ./apache2.conf /etc/apache2/apache2.conf
+
+# Enable default site (Firefly III)
+COPY ./apache-firefly-iii.conf /etc/apache2/sites-available/000-default.conf
# See also: https://github.com/JC5/firefly-iii-base-image