一、安装一个Docker
1、配置一个Docker的yum源
┌─[localhost]─[~]
└──╼ cat /etc/yum.repos.d/docker.repo
[docekr]
name=docker-centos7.7
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/7.7/x86_64/stable/
enabled=1
gpgcheck=0
2、安装Docker-ce(社区免费版)
yum install -y docker-ce
┌─[localhost]─[~]
└──╼ cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://mch6oeq2.mirror.aliyuncs.com"]
}
┌─[localhost]─[~]
└──╼ systemctl enable --now docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
┌─[localhost]─[~]
└──╼ systemctl status docker
┌─[localhost]─[~]
└──╼ docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
二、Docker中的一些基础操作
1、运行第一个容器
┌─[localhost]─[~]<