Lingserver-centos

来自ling
跳转至: 导航搜索

基本镜像制作

docker run --name lingserver-centos -t -i centos /bin/bash

退出后容器会stop,需要再次编辑是使用以下命令

docker start lingserver-centos
docker exec -it lingserver-centos bash

基本工具安装

安装wget

yum -y install wget 

配置yum镜像代理

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
yum update

提交镜像

清理不需要内容

yum clean all

提交并保存镜像[编辑]

docker ps
docker commit -m="lingserver-centos" -a="bo.wang" 0b2616b0e5a8 registry.cn-hangzhou.aliyuncs.com/ling/lingserver-centos:latest
docker login --username=102010cncger@sina.com registry.cn-hangzhou.aliyuncs.com
docker push registry.cn-hangzhou.aliyuncs.com/ling/lingserver-centos:latest
docker history registry.cn-hangzhou.aliyuncs.com/ling/lingserver-centos

Kubernetes集群

参考Kubernetes集群安装

docker run --name lingserver-kubernetes -t -i -v /alidata/dockerdata/ssl/:/etc/kubernetes/ssl registry.cn-hangzhou.aliyuncs.com/ling/lingserver-centos:latest /bin/bash
docker run --name lingserver-kubernetes -t -i -v /alidata/dockerdata/ssl/:/etc/kubernetes/ssl registry.cn-hangzhou.aliyuncs.com/ling/lingserver-kubernetes:latest /bin/bash

退出后容器会stop,需要再次编辑是使用以下命令

docker start lingserver-kubernetes 
docker exec -it lingserver-kubernetes bash

提交并保存镜像 清理不需要内容

yum clean all
docker ps
docker commit -m="lingserver-kubernetes" -a="bo.wang" lingserver-kubernetes registry.cn-hangzhou.aliyuncs.com/ling/lingserver-kubernetes:latest
docker login --username=102010cncger@sina.com registry.cn-hangzhou.aliyuncs.com
docker push registry.cn-hangzhou.aliyuncs.com/ling/lingserver-kubernetes:latest
docker history registry.cn-hangzhou.aliyuncs.com/ling/lingserver-kubernetes


/root/local/bin/etcd \
 --name=surface \
 --cert-file=/etc/kubernetes/ssl/kubernetes.pem \
 --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \
 --peer-cert-file=/etc/kubernetes/ssl/kubernetes.pem \
 --peer-key-file=/etc/kubernetes/ssl/kubernetes-key.pem \
 --trusted-ca-file=/etc/kubernetes/ssl/ca.pem \
 --peer-trusted-ca-file=/etc/kubernetes/ssl/ca.pem \
 --initial-advertise-peer-urls=https://lingserver-kubernetes:2380 \
 --listen-peer-urls=https://0.0.0.0:2380 \
 --listen-client-urls=https://0.0.0.0:2379\
 --advertise-client-urls=https://lingserver-kubernetes:2379 \
 --initial-cluster-token=mritd-etcd-cluster \
 --initial-cluster=surface=https://lingserver-kubernetes:2380 \
 --initial-cluster-state=new \
 --data-dir=/var/lib/etcd/default.etcd