docker简单安装与使用
官方一键安装脚本
curl -sSL https://get.docker.com/ | sh
github一键安装脚本
在线安装脚本:source <(curl -sL https://git.io/docker-install)
离线下载与安装脚本:
https://download.docker.com/linux/static/stable/
./install.sh -f /root/docker-18.09.6.tgz
网站:https://github.com/Jrohy/docker-install
docker管理面板Portainer安装与使用
官方安装命令:
docker run -d -p 9000:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /portainer_data:/data --name prtainer portainer/portainer
安装后http://IP:9000 登陆
常用docker应用集合:
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --name ui --restart=always lihaixin/portainer:me
安装后https://IP:9000 登陆
trojan安装
1.独立trojan安装命令(无面板)
curl -O https://raw.githubusercontent.com/atrandys/trojan/master/trojan_mult.sh && chmod +x trojan_mult.sh && ./trojan_mult.sh
systemctl restart trojan
2.trojan一键安装(带管理面板)
#安装/更新
source <(curl -sL https://git.io/trojan-install)
#卸载
source <(curl -sL https://git.io/trojan-install) --remove
https://github.com/Jrohy/trojan
https://github.com/TheWanderingCoel/Trojan-Qt5
3.完全docker安装trojan
I、安装mysql
因为mariadb内存使用比mysql至少减少一半, 所以推荐使用mariadb数据库
docker run --name trojan-mariadb --restart=always -p 3306:3306 -v /home/mariadb:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=trojan -e MYSQL_ROOT_HOST=% -e MYSQL_DATABASE=trojan -d mariadb:10.2
端口和root密码以及持久化目录都可以改成其他的
II、安装trojan
docker run -it -d --name trojan --net=host --restart=always --privileged jrohy/trojan init
运行完后进入容器 docker exec -it trojan bash, 然后输入'trojan'即可进行初始化安装
启动web服务: systemctl start trojan-web
设置自启动: systemctl enable trojan-web
更新管理程序: source <(curl -sL https://git.io/trojan-install)
附:
网络重装系统
wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/installNET/master/Install.sh"
chmod +x Install.sh
./Install.sh
网络加速脚本
wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh"
chmod +x tcp.sh
./tcp.sh
中转相关
iptables-pf.sh
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/iptables-pf.sh && chmod +x iptables-pf.sh && bash iptables-pf.sh
常用组件安装
apt-get install htop nload wget curl tar gzip bzip2 xz-utils unzip net-tools