一 docker簡介
docker是一個輕量級的,運作在使用者核心的一組程序,與主機系統想隔離。它有自己的程序,檔案系統和其它資源,它可以和其它主機共享實體主機核心。
二 安裝配置
yum install docker
systemctl start docker
systemctl enable docker
docker pull registry.access.redhat.com/redhat/rhel7
docker load -i rhel-server-docker-7.0.tar.gz
docker images
docker run -i -t --rm rhel7 cat /etc/hosts
docker ps -a
docker start -ai silly_fermi3
2.建立docker鏡像
docker run -i rhel7 bash -c "yum install -y httpd;"
docker ps -l
docker commit -m "RHEL7+httpd" dreamy_goodall1 rhel_httpd
docker run -p 8080:80 -d rhel_httpd /usr/sbin/httpd -DFOREGROUND
yum install docker-registry
systemctl start docker-registry
systemctl enable docker-registry
firewall-cmd --add-port=5000/tcp
firewall-cmd --add-port=5000/tcp --permanent
docker tag rhel_httpd registry.example.com:5000/usr/httpd
docker push registry.example.com:5000/user/httpd
三 案例
3.1 docker 私有倉庫搭建
3.2 docker 釋出一個web應用
3.3 docker 釋出一個mysql服務
3.4 docker高可用
本文轉自 woshiwei201 51CTO部落格,原文連結:http://blog.51cto.com/chenwei/1841979