1.Docker仓库:https://hub.docker.com
2.Docker 自身组件
Docker Client:Docker 的客户端
Docker Server:Docker daemon的主要组成部分,接受用户通过Docker Client
发出的请求,并按照相应的路由规则实现路由分发
Docker 镜像:Docker 镜像运行之后变成容器(docker run)
3.Docker工作方式
4.Docker安装
安装包下载地址https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
①关闭selinux
getenforce
②关闭firewalld,安装iptables
systemctl disable firewalld
yum install -y iptables-services
systemctl start iptables
iptables -F
service iptables save
③更新Linux操作系统,yum update -y执行完重启服务器
创建docker目录并拷贝安装
mkdir docker
mv docker* docker/
yum -y install *
④运行docker并运行hello-world镜像测试
systemctl start docker
systemctl enable docker
systemctl status docker
docker run hello-world
5.Docker镜像加速配置
cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service
chmod 777 /etc/systemd/system/docker.service
vim /etc/systemd/system/docker.service
修改ExecStart=/usr/bin/dockerd --registry-mirror=https://kfp63jaj.mirror.aliyuncs.com
systemctl daemon-reload
systemctl restart docker
ps -ef |grep docker
阿里云Docker官网:https://dev.aliyun.com/search.html可自行注册获取加速地址
6.Docker-compose install
容器编排工具,允许用户在一个模板(YAML格式)中定义一组相关联的容器,会根据--link等参数,对启动的优先级进行排序
下载地址:curl -L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
docker-compose version查看版本信息
国内高速下载地址:
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose