docker rancher 安装

1.rancher 中文文档

https://rancher.com/docs/rancher/v1.6/zh/

2.从阿里云拉取镜像

docker pull registry.cn-hangzhou.aliyuncs.com/ranchers/server:v1.6.5

3.创建数据库

CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8';

4.运行rancher

sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:v1.6.5 \
--db-host 192.168.9.110 --db-port 3306 --db-user root --db-pass 123456 --db-name cattle

5.创建docker-compose.yml 创建应用

version: '2'
services:
  mysql:
    image: mysql:5.5
    environment:
      MYSQL_ROOT_PASSWORD: 123456
    volumes:
    - /var/own/mysqldata:/var/lib/mysql
    ports:
    - 3306:3306
    labels:
      io.rancher.scheduler.affinity:host_label: hc-dev=node-01

 

posted @ 2019-03-30 18:34  点点_滴滴  阅读(1982)  评论(0编辑  收藏  举报