[why] lys@crystal ~/compass-ci/sbin% ./docker-pull centos:7 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 Digest: sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e Status: Image is up to date for centos:7
[how] if pull image failed from local repository, it will pull from docker hub, so hide error info for first failed pull.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- sbin/docker-pull | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sbin/docker-pull b/sbin/docker-pull index 5972913..d69af64 100755 --- a/sbin/docker-pull +++ b/sbin/docker-pull @@ -14,7 +14,7 @@ image_name=$1 local_repository() { echo "pull image from local repository" - docker pull $DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/$image_name && { + docker pull $DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/$image_name 2> /dev/null && { docker tag $DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT/$image_name $image_name } }