由於境外網絡問題HubDocker(docker.io),拉鏡像比較慢,改用阿里雲registry 容器鏡像服務。
注冊阿里雲賬號並登錄,進入阿里雲容器鏡像服務,創建個人公有倉庫。
在本地登錄我的個人:
sudo docker login --username=474033326@qq.com registry.cn-shanghai.aliyuncs.com
第一步:搜索鏡像,找出合適的鏡像
第二步:拉到本地
docker pull registry.cn-shanghai.aliyuncs.com/junior/alpine-php-swoole
docker images 可看到本地鏡像已成功拉去到
第三步:
docker run -it registry.cn-shanghai.aliyuncs.com/junior/alpine-php-swoole 開啟並進入容器,拿到containerID
第四步:提交容器記錄到我的倉庫
docker commit [containerID] 阿里雲倉庫域名/應用空間/倉庫名稱:版本
docker commit 14835a70d143 registry.cn-shanghai.aliyuncs.com/ys_php/psm:last
第五步:push鏡像到阿里雲公有倉庫
docker push registry.cn-shanghai.aliyuncs.com/ys_php/psm:last