简介
instantbox是一款非常实用的项目,它能够让你在几秒内启动一个主流的 Linux 系统,随起随用,支持 Ubuntu, CentOS, Arch Linux, Debian, Fedora 和 Alpine,通过 WebShell 访问,简单快捷,适合于演示、测试、体验等场合。
安装Docker
安装 Docker 与 Docker-Compose
curl -fsSL https://get.docker.com | bash -s docker
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
systemctl start docker
systemctl enable docker
安装instantbox
脚本安装
mkdir instantbox && cd $_
bash <(curl -sSL https://raw.githubusercontent.com/instantbox/instantbox/master/init.sh)
运行脚本过程中会等待输入IP
和端口
;
手动安装
创建docker-compose.yml
文件
mkdir instantbox && cd $_
vi docker-compose.yml
填入以下内容
version: '3'
services:
server:
image: instantbox/instantbox:latest
container_name: instantbox_server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- SERVERURL=<替换为服务器的IP>
networks:
- instantbox_net
frontend:
image: instantbox/instantbox-frontend:latest
container_name: instantbox_frontend
links:
- server
ports:
- <替换为端口>:80
networks:
- instantbox_net
cron:
image: instantbox/cron:latest
container_name: instantbox_cron
links:
- frontend
environment:
- CRON_STRINGS=* * * * * wget -qO /dev/null http://frontend/api/v2/superinspire/prune
networks:
- instantbox_net
networks:
instantbox_net:
保存退出后运行:
docker-compose up -d
完成
访问IP:端口