Docker的基本组成
Docker的安装
查看linux系统环境
cat /etc/os-release
安装相关组件
yum install -y yum-utils
设置镜像的仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新yum索引
yum makecache fast
安装docker
yum install docker-ce docker-ce-cli containerd.io
启动Docker
systemctl start docker
docker version
运行hello-world(会自动从官网下载镜像并运行)
docker run hello-world
如果出现报错:
docker: error pulling image configuration: Get https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/bf/bf756fb1ae65adf866bd8c456593cd24beb6a0a061dedf42b26a993176745f6b/data?verify=1614182046-p1DKLZH1u60%2FY33qvyG5bIrNI00%3D: read tcp 172.27.96.100:48858->104.18.122.25:443: read: connection reset by peer.
需要配置阿里云镜像仓库加速
# vim /etc/docker/daemon.json 添加如下
{
"registry-mirrors": ["https://0x3p2nkn.mirror.aliyuncs.com"]
}
# systemctl daemon-reload
# systemctl restart docker
查看本地镜像文件
docker images
卸载docker