| | | |
- # 查看centos版本 uname -a yum -y update
- # 安装 docker curl -sSL https://get.docker.com/ | sh yum install -y docker-selinux
- # 查看docker版本 docker --version
- # 启动docker服务 systemctl start docker.service
- # 测试docker安装成功 docker run hello-world
- # 配置Docker开机自启动: systemctl enable docker.service
- # 已安装镜像列表 docker images
- # 查找官方仓库centos镜像 docker search centos
- # pull 官方镜像,有时网络问题需要多尝试几次 sudo docker pull centos
- # 以终端方式运行;先查到id;或都也可以直接使用[REPOSITORY]:[tag]的方式 [root@localhost /]
复制代码
- # docker images REPOSITORY TAG IMAGE ID CREATED SIZE centos latest 8596123a638e 12 days ago 196.7 MB hello-world latest 94df4f0ce8a4 4 weeks ago 967 B sudo docker run -it 8596123a638e /bin/bash
复制代码
| | | | |
|