收藏文章 楼主

docker的搭建

版块:KVM虚拟化   类型:普通   作者:小绿叶技术博客   查看:3123   回复:1   获赞:2   时间:2019-07-01 14:20:27

[root@xiandian ~]# history 

    1  yum history list

    2  yum history undo 25

    3  yum history undo -y 24

    4  yum history undo -y 23

    5  yum history undo -y 22

    6  yum history undo -y 21

    7  cat /etc/yum.repos.d/local.repo 

[root@xiandian ~]# cat /etc/yum.repos.d/local.repo 

[centos]

name=centos

baseurl=ftp://10.32.18.195/centos7.2/

gpgcheck=0

enabled=1

[iaas]

name=iaas

baseurl=ftp://10.32.18.195/iaas2.2/iaas-repo/

gpgcheck=0

enabled=1

[docker]

name=docker

baseurl=ftp://10.32.18.195/docker2.2/docker/

gpgcheck=0

enabled=1



    8  yum history undo -y 21

    9  yum history undo -y 20

   10  yum history undo -y 19

   11  yum history undo -y 18

   12  clear 

   13  source /etc/keystone/admin-openrc.sh 

   14  wget ftp://10.32.18.195/images/cirros-0.3.0-x86_64-disk.img

   15  glance image-create --name exam --disk-format qcow2 --container-format bare --progress </root/cirros-0.3.0-x86_64-disk.img 

   16  mysql -uroot -p000000

   17  L

   18  getenforce 

   19  vi /etc/selinux/config 

   20  vi /etc/sysctl.conf 

net.ipv4.ip_forward=1

net.ipv4.conf.default.rp_filter=0

net.ipv4.conf.all.rp_filter=0

~


   21  reboot 

   22  reboot 

   23  sysctl -p

   24  getenforce 

   25  yum install -y docker-io

   26  vi /etc/sysconfig/docker

ADD_REGISTRY='--add-registry 10.32.24.174:5000'

INSECURE_REGISTRY='--insecure-registry 10.32.24.174:5000'

   27  systemctl restart docker

   28  systemctl enable docker

   29  docker pull httpd

   30  docker pull nginx

   31  docker pull busybox

   32  docker images 

   33  docker tag b7cc370ac278 docker.io/httpd:latest

   34  docker images 

   35  docker rmi -f 10.32.24.174:5000/httpd:latest

   36  docker images 

   37  docker tag  548cb73bef9a docker.io/nginx:latest

   38  docker rmi 10.32.24.174:5000/nginx:latest

   39  docker tag e02e811dd08f docker.io/busybox:latest

   40  docker rmi 10.32.24.174:5000/busybox:latest

   41  docker images

   42  docker run --name exam_1 --itd --restart=always httpd:latest /bin/bash

   43  docker run --name exam_1 -itd --restart=always httpd:latest /bin/bash

   44  docker run --name exam_2 -itd --restart=always httpd:latest /bin/bash

   45  docker run --name exam_3 -itd --restart=always httpd:latest /bin/bash

   46  docker ps

   47  source /etc/keystone/admin-openrc.sh 

   48  nova list

   49  nova start 4cbe6738-dc59-44c3-8d77-928cbbbb5e5b

   50  docker ps 

   51  source /etc/keystone/admin-openrc.sh 

   52  vi ./.bash_profile 

-----------------------------------------------------

[root@xiandian ~]# cat  ./.bash_profile 

# .bash_profile


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin


export PATH




if [[ `netstat -ntpl |grep http |grep -w "80"` == '' ]];then 

printf "\033[35m ---> Waiting for the service restart to completem\n\033[0m"

service httpd restart

source /etc/keystone/admin-openrc.sh 

nova start 4cbe6738-dc59-44c3-8d77-928cbbbb5e5b

docker start 1dff63461984 68254cd03f2d fcd3ad11e083

fi

----------------------------------------------------------------------------------------------------------


   53  vi /etc/rc.local 

printf "\033[35Waiting for the service restart to completem\033[0m"

service httpd restart

openstack-service restart

source /etc/keystone/admin-openrc.sh 

nova start 4cbe6738-dc59-44c3-8d77-928cbbbb5e5b

docker start 1dff63461984 68254cd03f2d fcd3ad11e083

touch /var/lock/subsys/local


   54  docker ps

   55  reboot 

提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:docker的搭建

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息