1 Commits

Author SHA1 Message Date
dependabot[bot]
16662afc28 build(deps): bump actions/upload-artifact from 4 to 5 (#74)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-22 21:24:17 +08:00
5 changed files with 58 additions and 21 deletions

View File

@@ -78,7 +78,7 @@ jobs:
- name: Store tar archive - name: Store tar archive
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: termux-docker-${{ matrix.CPU_ARCH }}-${{ github.sha }} name: termux-docker-${{ matrix.CPU_ARCH }}-${{ github.sha }}
path: termux-docker-${{ matrix.CPU_ARCH }}.tar path: termux-docker-${{ matrix.CPU_ARCH }}.tar

View File

@@ -2,7 +2,7 @@
# Bootstrap Termux environment. # Bootstrap Termux environment.
FROM scratch AS bootstrap FROM scratch AS bootstrap
ARG BOOTSTRAP_VERSION=2025.05.18-r1%2Bpacman-android-7%2Brutoken ARG BOOTSTRAP_VERSION=2023.02.19-r1%2Bapt-android-7
ARG BOOTSTRAP_ARCH=i686 ARG BOOTSTRAP_ARCH=i686
ARG SYSTEM_TYPE=x86 ARG SYSTEM_TYPE=x86
@@ -18,7 +18,7 @@ COPY /entrypoint.sh /entrypoint.sh
COPY /entrypoint_root.sh /entrypoint_root.sh COPY /entrypoint_root.sh /entrypoint_root.sh
# Extract bootstrap archive and create symlinks. # Extract bootstrap archive and create symlinks.
ADD https://darkline.cc/termux/bootstrap-$BOOTSTRAP_VERSION/bootstrap-$BOOTSTRAP_ARCH.zip /bootstrap.zip ADD https://github.com/termux/termux-packages/releases/download/bootstrap-$BOOTSTRAP_VERSION/bootstrap-$BOOTSTRAP_ARCH.zip /bootstrap.zip
RUN busybox mkdir -p /data/data/com.termux/files && \ RUN busybox mkdir -p /data/data/com.termux/files && \
cd /data/data/com.termux/files && \ cd /data/data/com.termux/files && \
busybox mkdir ../cache ./usr ./home && \ busybox mkdir ../cache ./usr ./home && \
@@ -56,13 +56,17 @@ RUN busybox chown -Rh 0:0 /system && \
busybox find /data -type d -exec busybox chmod 755 "{}" \; && \ busybox find /data -type d -exec busybox chmod 755 "{}" \; && \
busybox find /data/data/com.termux/files -type f -o -type d -exec busybox chmod g-rwx,o-rwx "{}" \; && \ busybox find /data/data/com.termux/files -type f -o -type d -exec busybox chmod g-rwx,o-rwx "{}" \; && \
cd /data/data/com.termux/files/usr && \ cd /data/data/com.termux/files/usr && \
busybox find ./bin ./libexec -type f -exec busybox chmod 700 "{}" \; busybox find ./bin ./lib/apt ./libexec -type f -exec busybox chmod 700 "{}" \;
# Install updates and cleanup when not building for arm. # Install updates and cleanup when not building for arm.
# out bootstrap is new enough
ENV PATH /data/data/com.termux/files/usr/bin ENV PATH /data/data/com.termux/files/usr/bin
RUN if [ ${SYSTEM_TYPE} = 'arm' ]; then exit; else \ RUN if [ ${SYSTEM_TYPE} = 'arm' ]; then exit; else \
/system/bin/mksh -T /dev/ptmx -c "/system/bin/dnsmasq -u root -g root --pid-file /dnsmasq.pid" && sleep 1; \ /system/bin/mksh -T /dev/ptmx -c "/system/bin/dnsmasq -u root -g root --pid-file /dnsmasq.pid" && sleep 1 && \
su - system -c "/data/data/com.termux/files/usr/bin/apt update" && \
su - system -c "/data/data/com.termux/files/usr/bin/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/* ;\
fi fi
############################################################################## ##############################################################################
@@ -77,12 +81,11 @@ ENV PATH /data/data/com.termux/files/usr/bin
ENV PREFIX /data/data/com.termux/files/usr ENV PREFIX /data/data/com.termux/files/usr
ENV TMPDIR /data/data/com.termux/files/usr/tmp ENV TMPDIR /data/data/com.termux/files/usr/tmp
ENV TZ UTC ENV TZ UTC
ENV TERM xterm
COPY --from=bootstrap / / COPY --from=bootstrap / /
WORKDIR /data/data/com.termux/files/home WORKDIR /data/data/com.termux/files/home
SHELL ["/data/data/com.termux/files/usr/bin/bash", "-l", "-c"] SHELL ["/data/data/com.termux/files/usr/bin/sh", "-c"]
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["/data/data/com.termux/files/usr/bin/bash","-l"] CMD ["/data/data/com.termux/files/usr/bin/login"]

46
build-all.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -e
OCI="docker"
OCI_ARG=""
case $1 in
-p|--podman) OCI="podman" ; OCI_ARG="--format docker" ;;
esac
if [ -n "${TERMUX_DOCKER_USE_SUDO-}" ]; then
SUDO="sudo"
else
SUDO=""
fi
case "$(uname -m)" in
aarch64) SYSTEM_TYPE="arm"; ARCHITECTURES=("aarch64" "arm");;
armv7l|armv8l) SYSTEM_TYPE="arm"; ARCHITECTURES=("arm");;
i686) SYSTEM_TYPE="x86"; ARCHITECTURES=("i686");;
x86_64) SYSTEM_TYPE="x86"; ARCHITECTURES=("i686" "x86_64");;
*)
echo "'uname -m' returned unknown architecture"
exit 1
;;
esac
for arch in "${ARCHITECTURES[@]}"; do
$SUDO $OCI build \
${OCI_ARG} \
-t 'termux/termux-docker:'"$arch" \
-f Dockerfile \
--build-arg BOOTSTRAP_ARCH="$arch" \
--build-arg SYSTEM_TYPE="$SYSTEM_TYPE" \
.
if [ "${1-}" = "publish" ]; then
$SUDO $OCI push 'termux/termux-docker:'"$arch"
fi
done
if [ "$SYSTEM_TYPE" = "x86" ]; then
$SUDO $OCI tag termux/termux-docker:i686 termux/termux-docker:latest
if [ "${1-}" = "publish" ]; then
$SUDO $OCI push 'termux/termux-docker:latest'
fi
fi

View File

@@ -1,11 +0,0 @@
#!/bin/bash
for CPU in "arm" "aarch64"
do
case $CPU in
arm) SYSTEM_TYPE=arm; PLATFORM_TAG="linux/arm/v7";;
aarch64) SYSTEM_TYPE=arm; PLATFORM_TAG="linux/arm64";;
i686) SYSTEM_TYPE=x86; PLATFORM_TAG="linux/386";;
*) SYSTEM_TYPE=x86; PLATFORM_TAG="linux/amd64";;
esac
docker buildx build -t termux-docker-pacman:$CPU --platform "$PLATFORM_TAG" --build-arg BOOTSTRAP_ARCH=${CPU} --build-arg SYSTEM_TYPE=${SYSTEM_TYPE} .
done

View File

@@ -31,5 +31,4 @@ exec /system/bin/su -s /data/data/com.termux/files/usr/bin/env system -- \
PREFIX="$PREFIX" \ PREFIX="$PREFIX" \
TMPDIR="$TMPDIR" \ TMPDIR="$TMPDIR" \
TZ=UTC \ TZ=UTC \
TERM=xterm \
"$@" "$@"