termux / termux-docker

Termux environment packaged as Docker image.
497 stars 70 forks source link

How to use `termux-docker` in GitHub Actions? #64

Open postmodern opened 6 months ago

postmodern commented 6 months ago

Hello, I want to test a bash installer script within the termux-docker image using GitHub Actions. While GitHub Actions does support running commands within a custom docker image/container, it does not honor the ENTRYPOINT of the image and insists on running everything as root. Even running the commands explicitly under /entrypoint.sh ... to drop privileges does not seem to work properly, due to permission issues. It also seems that the GitHub Actions actions/checkout module expects node to be installed at /__e/node20/bin/node. I also encountered strange networking issues when executing /entrypoint.sh ... multiple times. Is termux-docker even compatible with GitHub Actions? Maybe this is something that could be documented better?

sylirre commented 6 months ago

GitHub Actions issues first reported there: https://github.com/termux/termux-docker/issues/62

Is termux-docker even compatible with GitHub Actions?

It is not compatible. In fact termux-docker was originally made to run Termux environment locally, on PC.

There is no way to make it support root-only usage. Termux package manager is patched to disable usage as root user, so privilege dropping is mandatory.

Also you need to start a local DNS resolver, which is currently dnsmasq. It sometimes doesn't work properly and hangs with 100% CPU usage. However there currently no better variant.

agnostic-apollo commented 6 months ago

For package manager issue alone, patches could be updated to check some variable like $TERMUX__RUN_AS_USER==current_user before exiting.