Giter Club home page Giter Club logo

lxc-docker's Introduction

安卓lxc-docker内核修改

开启配置

./LXC-DOCKER-OPEN-CONFIG.sh <xxx_defconfig> -w

关闭:ANDROID_PARANOID_NETWORK

#..CONFIG_ANDROID_PARANOID_NETWORK is not set

打补丁1(有则打无则过)

xt_qtagui.patch

打补丁2(找准cgroup.c文件和函数位置打)

cgroup.patch

一、安装Termux

首先,你需要下载并安装 Termux

然后,打开 Termux,执行以下命令:

apt update
apt upgrade

二、安装必要的依赖

在Termux中执行以下命令:

pkg install root-repo
pkg install tsu docker

三、启动 Docker

1. 挂载 cgroup

sudo mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup

2. 启动 Docker 守护进程,并让它在后台运行

下面的运行策略二选一即可。如果你不清楚其中的具体区别,请选择第一种:

sudo dockerd --iptables=false &>/dev/null &
# or
sudo ip route add default via 192.168.1.1 dev wlan0
sudo ip rule add from all lookup main pref 30000
sudo dockerd &>/dev/null &

3. 测试 Docker 是否工作

sudo docker run hello-world

看到 hello world from docker 字样即表示 Docker 正常工作

常见问题

1. 容器内无网络

echo "nameserver 8.8.8.8" > /etc/resolv.conf
groupadd -g 3003 aid_inet && usermod -G nogroup -g aid_inet _apt

Reference

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.