From e4d9906625325c8fe854af3798fd7f99e5940013 Mon Sep 17 00:00:00 2001 From: NoNameWasDefined <169661348+NoNameWasDefined@users.noreply.github.com> Date: Wed, 17 Jun 2026 18:49:39 +0200 Subject: [PATCH] remove entrypoints - remove all entrypoint files (entrypoint.sh, entrypoint_root.sh) and all references to them - suggest in README.md to directly change the UID instead of using /entrypoint_root.sh to login as root --- Dockerfile | 2 +- README.md | 10 ++-------- entrypoint.sh | 22 ---------------------- entrypoint_root.sh | 12 ------------ generate.sh | 6 ------ 5 files changed, 3 insertions(+), 49 deletions(-) delete mode 100755 entrypoint.sh delete mode 100755 entrypoint_root.sh diff --git a/Dockerfile b/Dockerfile index e52e466..71ab393 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,5 +73,5 @@ COPY --from=bootstrap / / WORKDIR ${TERMUX__HOME} SHELL ["sh", "-c"] -ENTRYPOINT ["/entrypoint.sh"] +USER 1000:1000 CMD ["login"] diff --git a/README.md b/README.md index 1a15857..36a2164 100644 --- a/README.md +++ b/README.md @@ -107,18 +107,12 @@ docker run -it --rm termux/termux-docker bash -c "apt update && apt install -yq By default root shell is disabled in container as Termux doesn't really support usage of package manager under root account. In cases where you -really need shell with root privileges, entrypoint should be overridden. - -The provided images have 2 entry points: - -- `/entrypoint.sh` - the standard one which drops privileges to `system` - user. -- `/entrypoint_root.sh` - alternate entrypoint that does not drop privileges. +really need shell with root privileges, the user should be overridden. Usage example: ```.sh -docker run -it --entrypoint /entrypoint_root.sh termux/termux-docker +docker run -it --user 0 termux/termux-docker ``` ## Building image diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 82fc4b1..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/system/bin/sh - -if [ $# -lt 1 ]; then - set -- login -fi - -if [ "$(id -u)" != "0" ]; then - exec "$@" -fi - -exec /system/bin/su -s "$PREFIX/bin/env" system -- \ - -i \ - ANDROID_DATA="$ANDROID_DATA" \ - ANDROID_ROOT="$ANDROID_ROOT" \ - HOME="$HOME" \ - LANG="$LANG" \ - PATH="$PATH" \ - PREFIX="$PREFIX" \ - TMPDIR="$TMPDIR" \ - TZ="$TZ" \ - TERM="$TERM" \ - "$@" diff --git a/entrypoint_root.sh b/entrypoint_root.sh deleted file mode 100755 index 47c0e97..0000000 --- a/entrypoint_root.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/system/bin/sh - -if [ $# -lt 1 ]; then - set -- login -fi - -if [ "$(id -u)" != "0" ]; then - echo "Failure: /entrypoint_root.sh must be started as root." >&2 - exit 1 -fi - -exec "$@" diff --git a/generate.sh b/generate.sh index 3b3be5b..328e31b 100755 --- a/generate.sh +++ b/generate.sh @@ -410,12 +410,6 @@ root:x:0:0:root:/:/system/bin/sh system:x:1000:1000:system:${TERMUX__ROOTFS}/home:${TERMUX__PREFIX}/bin/login EOF -echo "[*] Copying entrypoint.sh to /..." -cp entrypoint.sh "${TERMUX_DOCKER__ROOTFS}/" - -echo "[*] Copying entrypoint_root.sh to /..." -cp entrypoint_root.sh "${TERMUX_DOCKER__ROOTFS}/" - echo "[*] Setting permissions..." find -L "${TERMUX_DOCKER__ROOTFS}/data" \ -type d -exec \