下载Docker前一定要记得切换镜像的源哦 (* ̄3 ̄)╭
去 阿里云容器服务 https://cr.console.aliyun.com/ 注册一个容器账户
进行源切换
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://uhvpi**7.mirror.aliyuncs.com"] } EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
| 命令 | 目的 |
|---|---|
| search centos | 搜索镜像 |
| images | 列出本地镜像 |
| pull debian:latest | 下载镜像:tag |
| rmi $IMAGE_ID/$TAG | 删除镜像 |
| run | 创建一个新的容器并运行一个命令 |
| start | 启动容器 |
| stop | 暂停容器 |
| restart | 重启容器 |
| cp | 用于容器与主机之间的数据拷贝 |