CI: Build image for arm

This commit is contained in:
Chongyun Lee
2022-04-23 22:28:32 +08:00
committed by Henrik Grimler
parent d3a17457fd
commit 36743e506b
3 changed files with 11 additions and 10 deletions

View File

@@ -18,6 +18,7 @@ jobs:
matrix:
CPU_ARCH:
- aarch64
- arm
- i686
- x86_64
steps:

View File

@@ -50,24 +50,25 @@ RUN busybox chown -Rh 0:0 /system && \
cd /data/data/com.termux/files/usr && \
busybox find ./bin ./lib/apt ./lib/bash ./libexec -type f -exec busybox chmod 700 "{}" \;
# Use utilities from Termux and switch user to non-root.
ENV PATH /data/data/com.termux/files/usr/bin
SHELL ["/data/data/com.termux/files/usr/bin/sh", "-c"]
# Switch user to non-root.
USER 1000:1000
# Update static DNS cache on login. Also symlink script and host list to prefix.
RUN echo "echo -e 'Updating static DNS:\n' && /system/bin/update-static-dns && echo" \
> /data/data/com.termux/files/home/.bashrc && \
ln -s /system/bin/update-static-dns /data/data/com.termux/files/usr/bin/update-static-dns && \
ln -s /system/etc/static-dns-hosts.txt /data/data/com.termux/files/usr/etc/static-dns-hosts.txt
busybox ln -s /system/bin/update-static-dns /data/data/com.termux/files/usr/bin/update-static-dns && \
busybox ln -s /system/etc/static-dns-hosts.txt /data/data/com.termux/files/usr/etc/static-dns-hosts.txt
# Update static DNS cache, install updates and cleanup.
RUN /system/bin/update-static-dns && \
# Update static DNS cache, install updates and cleanup when not building for arm.
ENV PATH /data/data/com.termux/files/usr/bin
RUN if [ ${BOOTSTRAP_ARCH} == 'arm' ]; then exit; else \
update-static-dns && \
apt update && \
apt upgrade -o Dpkg::Options::=--force-confnew -yq && \
rm -rf /data/data/com.termux/files/usr/var/lib/apt/* && \
rm -rf /data/data/com.termux/files/usr/var/log/apt/* && \
rm -rf /data/data/com.termux/cache/apt/*
rm -rf /data/data/com.termux/cache/apt/* ;\
fi
##############################################################################
# Create final image.

View File

@@ -40,8 +40,7 @@ Running image:
There a number of known issues which may not be resolved:
* ARM containers may require a custom seccomp profile to remove restrictions from
`personality()` system call. Whereas Docker Hub contains prebuilt ARM image, it
is outdated and won't receive updates anymore.
`personality()` system call.
* DNS: Docker image has to use a static DNS resolver through `/system/etc/hosts`.
You can regenerate this file by editing `/system/etc/static-dns-hosts.txt` and