[why] lys@crystal ~/compass-ci/providers% ./my-docker dc-1g.lys dc-1g~lys Donehttp://$DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/boot.container/hostname/d... pull image from local repository Error response from daemon: manifest for 127.0.0.1:5001/centos:7 not found pull image from docker hub 7: Pulling from library/centos
because lacking of judgment before pull image from local repository, if local repository not found images, it will show error message.
[how] if no images in local repository, not pull from local repository, just pull from docker hub.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- sbin/docker-pull | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sbin/docker-pull b/sbin/docker-pull index 5972913..d5b90dc 100755 --- a/sbin/docker-pull +++ b/sbin/docker-pull @@ -25,9 +25,16 @@ docker_hub() docker pull $image_name }
+query_local_repository() +{ + local image_array=($(echo "$image_name"|tr ':' ' ')) + image=$(curl -s -X GET http://$DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/v2/$%7Bimage_array%5B0%5D...) + echo $image| grep -q ${image_array[0]} && local_repository +} + main() { - local_repository || docker_hub + query_local_repository || docker_hub }
main
On Tue, Nov 17, 2020 at 04:59:38PM +0800, Liu Yinsi wrote:
[why] lys@crystal ~/compass-ci/providers% ./my-docker dc-1g.lys dc-1g~lys
./my-docker need not parameter
Donehttp://$DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/boot.container/hostname/d... pull image from local repository Error response from daemon: manifest for 127.0.0.1:5001/centos:7 not found pull image from docker hub 7: Pulling from library/centos
because lacking of judgment before pull image from local repository, if local repository not found images, it will show error message.
[how] if no images in local repository, not pull from local repository, just pull from docker hub.
Signed-off-by: Liu Yinsi liuyinsi@163.com
sbin/docker-pull | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sbin/docker-pull b/sbin/docker-pull index 5972913..d5b90dc 100755 --- a/sbin/docker-pull +++ b/sbin/docker-pull @@ -25,9 +25,16 @@ docker_hub() docker pull $image_name }
+query_local_repository() +{
- local image_array=($(echo "$image_name"|tr ':' ' '))
- image=$(curl -s -X GET http://$DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/v2/$%7Bimage_array%5B0%5D...)
- echo $image| grep -q ${image_array[0]} && local_repository
+}
docker-pull xxx 2>/dev/null
error info can be hidden
Thanks, Shenwei
main() {
- local_repository || docker_hub
- query_local_repository || docker_hub
}
main
2.23.0
[why] lys@crystal ~/compass-ci/providers% ./my-docker dc-1g.lys dc-1g~lys
./my-docker
ok
need not parameter
Donehttp://$DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/boot.container/hostname/d... pull image from local repository Error response from daemon: manifest for 127.0.0.1:5001/centos:7 not found pull image from docker hub 7: Pulling from library/centos
because lacking of judgment before pull image from local repository, if local repository not found images, it will show error message.
[how] if no images in local repository, not pull from local repository, just pull from docker hub.
Signed-off-by: Liu Yinsi liuyinsi@163.com
sbin/docker-pull | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sbin/docker-pull b/sbin/docker-pull index 5972913..d5b90dc 100755 --- a/sbin/docker-pull +++ b/sbin/docker-pull @@ -25,9 +25,16 @@ docker_hub() docker pull $image_name }
+query_local_repository() +{
- local image_array=($(echo "$image_name"|tr ':' ' '))
- image=$(curl -s -X GET http://$DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/v2/$%7Bimage_array%5B0%5D...)
- echo $image| grep -q ${image_array[0]} && local_repository
+}
docker-pull xxx 2>/dev/null
error info can be hidden
ok
Thanks, Yinsi
Thanks, Shenwei
main() {
- local_repository || docker_hub
- query_local_repository || docker_hub
}
main
2.23.0