Skip to content

Commit 770d46b

Browse files
authored
Merge pull request #1 from wickedyoda/codex/create-armv7-32-bit-build-setup
Add armv7 build support
2 parents 0158759 + 8f688fd commit 770d46b

File tree

3 files changed

+107
-0
lines changed

3 files changed

+107
-0
lines changed

.github/workflows/build_armhf.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build ARMv7
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-armhf:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v3
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
16+
- name: Build ARMv7 image
17+
uses: docker/build-push-action@v5
18+
with:
19+
context: .
20+
file: Dockerfile.armhf
21+
platforms: linux/arm/v7
22+
push: false

Dockerfile.armhf

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.22
4+
5+
ARG BUILD_DATE
6+
ARG VERSION
7+
ARG SPEEDTEST_TRACKER_VERSION
8+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
9+
LABEL maintainer="thespad"
10+
11+
ENV HOME=/config
12+
13+
RUN \
14+
apk add --no-cache \
15+
grep \
16+
php84-gd \
17+
php84-intl \
18+
php84-pdo_mysql \
19+
php84-pdo_pgsql \
20+
php84-pdo_sqlite \
21+
php84-pecl-redis \
22+
php84-tokenizer \
23+
php84-xmlreader \
24+
postgresql16-client \
25+
ssmtp && \
26+
apk add --no-cache --virtual=build-dependencies \
27+
npm && \
28+
echo "*** install speedtest-cli ***" && \
29+
if [ -z ${CLI_VERSION+x} ]; then \
30+
CLI_VERSION=$(curl -Ls https://packagecloud.io/ookla/speedtest-cli/debian/dists/bookworm/main/binary-armhf/Packages \
31+
| sed -n '/Package: speedtest/,/Homepage:/p' \
32+
| grep -oP 'Version: \K\S+' | cut -d. -f1-3); \
33+
fi && \
34+
curl -o \
35+
/tmp/speedtest-cli.tgz -L \
36+
"https://install.speedtest.net/app/cli/ookla-speedtest-${CLI_VERSION}-linux-armhf.tgz" && \
37+
tar xzf \
38+
/tmp/speedtest-cli.tgz -C \
39+
/usr/bin && \
40+
echo "**** configure php-fpm to pass env vars ****" && \
41+
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php84/php-fpm.d/www.conf && \
42+
grep -qxF 'clear_env = no' /etc/php84/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php84/php-fpm.d/www.conf && \
43+
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php84/php-fpm.conf && \
44+
echo "*** install speedtest-tracker ***" && \
45+
if [ -z ${SPEEDTEST_TRACKER_VERSION+x} ]; then \
46+
SPEEDTEST_TRACKER_VERSION=$(curl -sX GET "https://api.github.com/repos/alexjustesen/speedtest-tracker/releases/latest" \
47+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
48+
fi && \
49+
curl -o \
50+
/tmp/speedtest-tracker.tar.gz -L \
51+
"https://github.com/alexjustesen/speedtest-tracker/archive/${SPEEDTEST_TRACKER_VERSION}.tar.gz" && \
52+
mkdir -p /app/www && \
53+
tar xzf \
54+
/tmp/speedtest-tracker.tar.gz -C \
55+
/app/www/ --strip-components=1 && \
56+
cd /app/www && \
57+
composer install \
58+
--no-interaction \
59+
--prefer-dist \
60+
--optimize-autoloader \
61+
--no-dev \
62+
--no-cache && \
63+
npm ci && npm run build && \
64+
echo "**** setup php opcache ****" && \
65+
{ \
66+
echo 'opcache.enable_cli=1'; \
67+
} > /etc/php84/conf.d/opcache-recommended.ini; \
68+
{ \
69+
echo 'post_max_size = 100M'; \
70+
echo 'upload_max_filesize = 100M'; \
71+
echo 'variables_order = EGPCS'; \
72+
} > /etc/php84/conf.d/php-misc.ini && \
73+
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
74+
echo "**** cleanup ****" && \
75+
apk del --purge build-dependencies && \
76+
rm -rf \
77+
$HOME/.cache \
78+
$HOME/.npm \
79+
/app/www/node_modules \
80+
/tmp/*
81+
82+
COPY root/ /
83+
84+
VOLUME /config

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project_categories: "Monitoring"
1010
available_architectures:
1111
- {arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
1212
- {arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
13+
- {arch: "{{ arch_armhf }}", tag: "arm32v7-latest"}
1314
# container parameters
1415
common_param_env_vars_enabled: true
1516
param_container_name: "{{ project_name }}"

0 commit comments

Comments
 (0)