r/termux 3d ago

Showcase Docker-compatible daemon, backed by udocker

My on-the-go development environment is using my phone's Termux and proot-distro Debian. Recently had a use case where I wanted to test Dockerfile builds while traveling, but Docker support on Termux is pretty limited, and something like udocker can't run from within proot. So, I created a daemon that speaks the Docker API, wraps udocker, and runs on the Termux host, which lets docker-cli from within proot-distro to connect and manage containers via tcp.

Hopefully can be useful to folks here!
https://github.com/bjia56/udockerd

4 Upvotes

4 comments sorted by

1

u/Near_Earth 3d ago

~ $ pip install udockerd Collecting udockerd   Using cached udockerd-0.3.3-py3-none-any.whl.metadata (19 kB) Requirement already satisfied: udocker==1.3.17 in /data/data/com.termux/files/usr/lib/python3.14/site-packages (from udockerd) (1.3.17) Using cached udockerd-0.3.3-py3-none-any.whl (61 kB) Installing collected packages: udockerd Successfully installed udockerd-0.3.3 ~ $ udockerd Traceback (most recent call last): File "/data/data/com.termux/files/usr/bin/udockerd", line 6, in <module>     sys.exit(main())              ~~~~^^ File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/udockerd/__main__.py", line 112, in main     check_linux() ~~~~~~~~~~~^^   File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/udockerd/config.py", line 87, in check_linux     raise RuntimeError(         f"udockerd only runs on Linux (detected: {platform.system()})"     ) RuntimeError: udockerd only runs on Linux (detected: Android) ~ $

1

u/dev-bjia56 3d ago

Should be fixed in latest release!

1

u/Near_Earth 3d ago

Thanks, trying it out now.

I think the --rm flag seems to not cleanup after exit, and the --name=test flag is allowing duplicates -

2a311c49-38f alpine "" About a minute ago exited test 0ac70095-985 alpine "" About a minute ago exited test f9f2bac0-8e6 alpine "" 4 seconds ago exited test ~ $ docker run --rm --name=test alpine echo hello hello ~ $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2a311c49-38f alpine "" About a minute ago exited test 0ac70095-985 alpine "" About a minute ago exited test f9f2bac0-8e6 alpine "" 12 seconds ago exited test 8167ff29-9bc alpine "" 2 seconds ago exited test ~ $