docker的简单使用:mac下docker配置http镜像源,并pull和push镜像
1.安装后,配置http的镜像源,如下图路径(registry为国内加速器,insecure为自己的:ip+端口)
若上面不行在配网络代理,最后重启服务
2.pull镜像
格式:docker pull 配的镜像地址/项目名/仓库名:标签
docker pull 172.xx.xx.58:80/production/test:latest
pull完了可以查看一下:
docker images 查看本地镜像
3.如何push本地镜像到仓库
1)先登录到仓库
2)查看镜像ID 、tag
3)打tag 然后上传
命令解析
docker tag hello-world:latest 172.xx.xx.58:80/production/hello_test:v1
docker命令
tag 打tag
hello-world:latest 本地镜像名字和Tag版本
172.xx.xx.58:80 harbor仓库位置
production 仓库的项目名字
hello_test:v1 为存储在仓库中的名字和标签