• Stars
    star
    435
  • Rank 100,085 (Top 2 %)
  • Language
    Dockerfile
  • Created about 5 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Termux environment packaged as Docker image.

Termux environment for Docker/Podman.

A Termux environment packaged into Docker image. Environment doesn't have Android runtime components, so certain things will not be available (DalvikVM, OpenSLES, etc...).

How to use

Requirements

You should have a properly configured and running Docker or Podman container systems. Further instructions will provide examples only for Docker.

Basic usage

This will start interactive login shell. Everything will look like in a normal Termux installation.

docker run -it termux/termux-docker:latest

When using the tag latest, container will be 32 bit (i686 architecture).

Other architecture can be installed using a different tags. Available tags:

  • aarch64
  • arm
  • i686 (latest)
  • x86_64

If architecture is not compatible with host, the additional setup will be needed. Read this document further to learn how you can run containers of incompatible CPU architecture.

Important note: do not pass --user option to Docker command line. The initial user of container must be root. Otherwise DNS will be broken because of dnsmasq server failure.

Running ARM containers on x86 host

In order to run AArch64 container on x86(64) host, you need to setup QEMU emulator through binfmt_misc. This can be easily done by one command:

docker run --rm --privileged aptman/qus -s -- -p aarch64 arm

Note that AArch64 and ARM containers work properly only in privileged mode. If you want your containers to have standard privileges, a custom seccomp profile is required.

Variant with privileged container:

docker run -it --privileged termux/termux-docker:aarch64

Variant with seccomp unconfined profile:

docker run -it --security-opt seccomp:unconfined termux/termux-docker:aarch64

Non-interactive execution of commands

You can run commands in non-interactive mode. Just append them to Docker command line.

Example:

docker run -it --rm termux/termux-docker:latest bash -c "apt update && apt install -yq clang"

Root shell

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.

Usage example:

docker run -it --entrypoint /entrypoint_root.sh termux/termux-docker:latest

Building image

Docker:

./build-all.sh

Podman:

./build-all.sh --podman

Known issues

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.

  • When running certain multi threaded program in 32bit containers, the PIDs can balloon and easily exceed libc's limit. The only way to fix this is to set /proc/sys/kernel/pid_max to 65536. See termux-docker#40.

More Repositories

1

termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
Java
34,406
star
2

termux-packages

A package build system for Termux.
Shell
12,914
star
3

termux-api

Termux add-on app which exposes device functionality as API to command line programs.
Java
2,204
star
4

termux-x11

Termux X11 add-on application.
C
1,412
star
5

proot-distro

An utility for managing installations of the Linux distributions in Termux.
Shell
1,403
star
6

termux-styling

Termux add-on app for customizing the terminal font and color theme.
Kotlin
1,142
star
7

termux-api-package

Termux package containing scripts to call functionality in Termux:API.
Shell
1,015
star
8

termux-root-packages

Termux packages that are only usable by root users.
Shell
1,012
star
9

termux-widget

Termux add-on app which adds shortcuts to commands on the home screen.
Java
923
star
10

termux-tasker

Termux add-on app for integration with Tasker.
Java
850
star
11

termux-boot

Termux add-on app allowing programs to be run at boot.
Java
800
star
12

proot

An chroot-like implementation using ptrace.
C
747
star
13

termux.github.io

The main termux site and help pages.
HTML
746
star
14

termux-gui

A plugin for Termux to use native Android GUI components from CLI applications.
Kotlin
570
star
15

x11-packages

A set of packages using X11 Windows System.
Shell
535
star
16

termux-float

Termux add-on app to show the terminal in a floating terminal window.
Java
414
star
17

termux-create-package

Python script to create Termux packages easily.
Python
388
star
18

game-packages

Games for Termux
Shell
308
star
19

termux-services

Scripts to handle services in termux.
Shell
293
star
20

termux-apt-repo

Script to create Termux apt repositories.
Python
286
star
21

termux-tools

Scripts and small programs that are packaged into termux's termux-tools package
Shell
210
star
22

science-packages

Science packages for Termux
C
207
star
23

termux-elf-cleaner

Utility to remove unused ELF sections causing warnings.
C
200
star
24

termux-exec

A execve() wrapper to fix problem with shebangs.
C
161
star
25

command-not-found

Utility for suggesting packages in case typed command was not found.
C++
157
star
26

play-audio

Command-line tool to play audio using OpenSL ES.
C++
122
star
27

termux-auth

Password authentication utilities for Termux.
C
116
star
28

libandroid-shmem

System V shared memory emulation on Android using ashmem.
C
114
star
29

TermuxAm

Android Oreo-compatible am command reimplementation.
Java
98
star
30

termux-packaging

Termux packaging tools.
Rust
90
star
31

repology-metadata

Scripts and Github Actions workflow for generating Repology metadata.
Shell
77
star
32

termux-language-server

🛠️ A language server for some specific bash scripts
Python
73
star
33

termux-root-packages-21-bin

termux-root-packages debs for android 5 and 6. Archived from Bintray repository.
53
star
34

termux-failsafe

An app providing a way to launch failsafe sessions.
Kotlin
47
star
35

wcwidth

A Unicode 15-conformant implementation of wcwidth() in C.
C
40
star
36

termux.com

Sync for termux.github.io/termux.dev at termux.com
39
star
37

libandroid-support

C
32
star
38

termux-am-socket

Faster termux-am implementation that connects to a receiver in termux-app using a unix socket
Shell
32
star
39

science-packages-21-bin

science-package debs for android 5 and 6. Archived from Bintray repository.
25
star
40

getconf

A simple standalone getconf(1) implementation.
C
25
star
41

game-packages-21-bin

game-package debs for android 5 and 6. Archived from Bintray repository.
24
star
42

whatprovides

Utility to find out packages using specific files. Deprecated in favor of apt-file.
Shell
22
star
43

shared-library-testcase

Test case for shared library symbol visibility on dlopen().
C
14
star
44

termux-am-library

Java
14
star
45

distfiles

Moved from https://dl.bintray.com/termux/upstream
11
star
46

create-conventional-changelog

Shell
7
star
47

glibc-packages

Glibc packages for termux (repository mirror)
Shell
7
star
48

termux-community

5
star
49

libandroid-utimes

Library with futimes, futimesat, lutimes from bionic
C
2
star