Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-android

Docker for android using chroot-distro and pivot_root

Step 0 - Install alpine and pivot_root into it

chroot-distro install alpine
./pivot_alpine.sh

Step 1 - Create the docker storage and format it

dd if=/dev/zero of=/docker-storage.img bs=1M count=10240
mkfs.ext4 /docker-storage.img
apk add mkfs.ext4
apk add e2fsprogs
mkfs.ext4 /docker-storage.img
mkdir -p /var/lib/docker

Step 1.1 - Install the magisk module (this repository) and install it from magisk

Step 1.2 - Install docker (v24 matters here)

wget https://download.docker.com/linux/static/stable/aarch64/docker-24.0.9.tgz
tar -xzf docker-24.0.9.tgz
mv docker/* /usr/local/bin/
rm -rf docker docker-24.0.9.tgz

Step 1.3 - Install iptables-legacy

apk add iptables-legacy
## Then symlink /bin/iptables to /bin/iptables-legacy
rm -f /usr/sbin/iptables
ln -sf /usr/sbin/iptables-legacy /usr/sbin/iptables
ln -sf /usr/sbin/ip6tables-legacy /usr/sbin/ip6tables

Step 2 - Add crun and test

apk search crun
apk info crun 2>/dev/null | head -5

# If available:
apk add crun
crun --version

# Test it against the same cgroup layout
mkdir -p /tmp/crun-test/rootfs
cd /tmp/crun-test
cp -a /bin /etc /lib /usr rootfs/ 2>/dev/null
crun spec
crun run testctr 2>&1 | head -20
cd -

Step 3 - Start docker and test

./start_docker.sh
docker run hello-world

About

Docker for android using `chroot-distro+serviced` and `pivot_root` in Alpine!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages