Fabric-Failed to connect to goo.gl port 443: Connection timed out

在搭建Fabric 1.0 開發(fā)環(huán)境時(shí)官方文檔:http://hyperledger-fabric.readthedocs.io/en/latest/samples.html#binaries 介紹使用如下命令下載Fabric平臺相關(guān)的可執(zhí)行文件和docker鏡像:

curl -sSL https://goo.gl/Gci9ZX | bash

但是基本上都會(huì)遇到下面的錯(cuò)誤:

curl: (7) Failed to connect to goo.gl port 443: Connection timed out

這個(gè)問題google了也未必能解決,網(wǎng)上的說法一大堆,有的說是ipv6導(dǎo)致,有的說是防火墻導(dǎo)致。。。

如果是Fabric,我這里推薦一種做法,無意間發(fā)現(xiàn)的,沒想到竟然有效果:

step1

在瀏覽器中打開命令curl -sSL https://goo.gl/Gci9ZX | bash中的這個(gè)鏈接https://goo.gl/Gci9ZX(需要翻墻),然后你可以看到這其實(shí)就是一個(gè)shell腳本,內(nèi)容如下:

#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

export VERSION=1.0.2
export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}')
#Set MARCH variable i.e ppc64le,s390x,x86_64,i386
MARCH=`uname -m`

dockerFabricPull() {
  local FABRIC_TAG=$1
  for IMAGES in peer orderer couchdb ccenv javaenv kafka zookeeper tools; do
      echo "==> FABRIC IMAGE: $IMAGES"
      echo
      docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
      docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES
  done
}

dockerCaPull() {
      local CA_TAG=$1
      echo "==> FABRIC CA IMAGE"
      echo
      docker pull hyperledger/fabric-ca:$CA_TAG
      docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
}

: ${CA_TAG:="$MARCH-$VERSION"}
: ${FABRIC_TAG:="$MARCH-$VERSION"}

echo "===> Downloading platform binaries"
curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz

echo "===> Pulling fabric Images"
dockerFabricPull ${FABRIC_TAG}

echo "===> Pulling fabric ca Image"
dockerCaPull ${CA_TAG}
echo
echo "===> List out hyperledger docker images"
docker images | grep hyperledger*

腳本也就主要做了兩件事:下載平臺相關(guān)可執(zhí)行文件和下載fabric docker鏡像。

step2

在你的本地目錄新建download.sh(名字隨便起),將網(wǎng)頁上的內(nèi)容復(fù)制到文件里,然后保存退出執(zhí)行以下命令:

chmod a+x download.sh

然后執(zhí)行命令:

./download.sh

你可以看到已經(jīng)開始下載了!

PS:這里第一階段下載平臺相關(guān)執(zhí)行文件可以翻墻要快一些,然后當(dāng)開始下載docker鏡像時(shí)關(guān)掉代理。為了使docker下載快一點(diǎn),記得配置docker加速器!


版權(quán)所有,轉(zhuǎn)載請注明出處。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容