本地pull
docker pull swr.cn-north-1.myhuaweicloud.com/ckeny/demo_tank:v1.0.1
查看是否PULL下镜像
docker images | grep tank
2 上传镜像
这些镜像在后续的课程操作中需要使用,下载方法与第一步介绍相同,直接在已登陆的窗
口中,执行下面这些命令行即可。
docker pull swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-productpage-v1:1.5.0
docker pull swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-details-v1:1.5.0
docker pull swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-ratings-v1:1.5.0
docker pull swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-reviews-v1:1.5.0-v2
docker pull swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-reviews-v1:1.5.0-v3
以上命令完成后,再执行docker images|grep istio 查看以上镜像是否已完全下载到本地。
上传公共镜像到自己仓库:
将以上镜像逐个上传到指定的 组织名称(ckeny) 下
1
docker tag swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-productpage-v1:1.5.0 swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-productpage-v1:1.5.0
sudo docker push swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-productpage-v1:1.5.0
2
docker tag swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-details-v1:1.5.0 swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-details-v1:1.5.0
sudo docker push swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-details-v1:1.5.0
3
docker tag swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-ratings-v1:1.5.0 swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-ratings-v1:1.5.0
sudo docker push swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-ratings-v1:1.5.0
4
docker tag swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-reviews-v1:1.5.0-v2 swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-reviews-v1:1.5.0-v2
sudo docker push swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-reviews-v1:1.5.0-v2
5
docker tag swr.cn-north-1.myhuaweicloud.com/istio-sample/examples-bookinfo-reviews-v1:1.5.0-v3 swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-reviews-v1:1.5.0-v3
sudo docker push swr.cn-north-1.myhuaweicloud.com/ckeny/examples-bookinfo-reviews-v1:1.5.0-v3
docker run --name tank -d -p 8080:80 8a528e9553c6
挂载镜像并运行容器访问
docker cp tank:/etc/nginx/conf.d/default.conf ./
vim default.conf
PS: 修改listen的端口号8080
docker run -d –name tank1 -p 8081:8080 -v $PWD/default.conf:/etc/nginx/conf.d/default.conf 8a528e9553c6
总结对比昨天,主要今天使用的挂载外部配置文件来运行Docker