Skip to content

Instantly share code, notes, and snippets.

@ankit1057
Created June 18, 2023 12:21
Show Gist options
  • Select an option

  • Save ankit1057/74334ef4c355500fb4a51e3e072486e2 to your computer and use it in GitHub Desktop.

Select an option

Save ankit1057/74334ef4c355500fb4a51e3e072486e2 to your computer and use it in GitHub Desktop.
Install Docker on Android no root

Docker run 20 instances of Alpine Linux with Tor and Chrome, each refreshing itself every 10 minutes, all on just 2GB of RAM. You can use this to supercharge your testing, browsing, or anything else you want to do with rootless Docker on Alpine Linux.

Using Termux, QEMU, Alpine virtualization, and the VMConsole app on Android, you'll build a powerful and secure local network for super fast builds - all without needing root access on your smartphone.

In this video tutorial, you'll learn how to:

  • Install Docker and Docker Compose on Alpine Linux

  • Clone, compose, and build the necessary repositories

  • Set up your disk and run a Docker Compose build

  • Test your setup by running a Hello World image in Docker

Don't miss this opportunity to learn how to run rootless Docker on Alpine Linux with VMConsole. Watch the video below and prepare to be amazed!

Prerequisites

To follow along with this tutorial, you'll need:

  • An Android smartphone with at least 2GB of RAM

  • Termux app installed on your smartphone

  • QEMU app installed on your smartphone

  • VMConsole app installed on your smartphone

  • A stable internet connection

Installation

Step 1: Install Docker and Docker Compose on Alpine Linux

To install Docker and Docker Compose on Alpine Linux, you need to update the local package repositories using the command:

apk update

Then, you can install Docker Engine and Compose using the command:

apk add docker docker-compose

After installation, you need to start and enable the Docker service. If you encounter an "unsatisfiable constraints error", you may need to edit the /etc/apk/repositories file to add a line. There are also instructions available for building a Docker image and running a container on Alpine Linux¹²³⁴⁵.

To start and enable the Docker service, run:

rc-update add docker default

/etc/init.d/docker start

Step 2: Clone, compose, and build the necessary repositories

To clone this repository, run:

git clone https://github.com/soumyadityac/youtube-viewer.git

To compose and build the necessary repositories, run:

cd youtube-viewer

docker-compose up -d --build

This will create 20 instances of Alpine Linux with Tor and Chrome, each refreshing itself every 10 minutes.

Step 3: Set up your disk and run a Docker Compose build

To set up your disk and run a Docker Compose build, follow these steps:

  • Open the VMConsole app on your smartphone and tap on "Create New VM".

  • Enter a name for your VM, such as "Alpine Linux".

  • Select "Linux" as the OS type and "Alpine Linux" as the OS version.

  • Set the RAM size to 2GB and the disk size to 10GB.

  • Tap on "Create" and wait for the disk creation to finish.

  • Tap on "Start" to boot up your VM.

  • Open the Termux app on your smartphone and type:

ssh root@localhost -p 2222

This will connect you to your VM via SSH.

  • Enter "yes" when prompted to accept the host key.

  • Enter "alpine" as the password when prompted.

  • Type:

cd /root/youtube-viewer

docker-compose up -d --build

This will run a Docker Compose build on your VM.

Step 4: Test your setup by running a Hello World image in Docker

To test your setup by running a Hello World image in Docker, follow these steps:

  • Open the QEMU app on your smartphone and tap on "Connect".

  • Enter "localhost" as the host name and "2222" as the port number.

  • Tap on "Connect" and wait for the connection to establish.

  • Tap on "Open Console" to open a graphical console of your VM.

  • Type:

docker run hello-world

This will run a Hello World image in Docker.

You should see a message like this:

Hello from Docker!

This message shows that your installation appears to be working correctly.

...

Congratulations! You have successfully installed and used Docker on Alpine Linux. You can now run 20 instances of Alpine Linux with Tor and Chrome on your smartphone without rooting it. Enjoy!

Source: Conversation with Bing, 6/18/2023

(1) How to install Docker Engine on Alpine Linux - Linux Shout. https://www.how2shout.com/linux/how-to-install-docker-engine-on-alpine-linux/.

(2) Install the Compose plugin | Docker Documentation. https://docs.docker.com/compose/install/linux/.

(3) How to install docker & docker-compose on Alpine Linux. https://techoverflow.net/2021/05/07/how-to-install-docker-docker-compose-on-alpine-linux/.

(4) How to Install and Use Docker on Alpine Linux - Linux Shell Tips. https://www.linuxshelltips.com/install-docker-alpine-linux/.

(5) How to install Docker Engine on Alpine Linux - Linux Shout. https://linux.how2shout.com/how-to-install-docker-engine-on-alpine-linux/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment