不使用外建数据库
docker run -d --restart=unless-stopped -p 8080:8080 rancher/server
外置数据库
CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8';
GRANT ALL ON cattle.* TO 'cattle'@'%' IDENTIFIED BY 'cattle';
GRANT ALL ON cattle.* TO 'cattle'@'localhost' IDENTIFIED BY 'cattle';
安装镜像并启动容器
docker run -d --restart=unless-stopped -p 8080:8080 rancher/server --db-host 127.0.0.1 --db-port 3306 --db-user root --db-pass root --db-name cattle