先新建一個Go的工做空間文件夾,文件夾路徑建議放在$HOME下:linux
userdeMacBook-Pro:~ user$ cd $HOME userdeMacBook-Pro:~ user$ mkdir go userdeMacBook-Pro:~ user$ $PATH -bash: ./usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin:/usr/local/bin: No such file or directory
編輯.bash_profile文件,若是沒有請新建。在文件末尾加上:docker
#GOPATH export GOPATH=$HOME/go #GOBIN export GOBIN=$GOPATH/bin export PATH=$PATH:$GOBIN
編輯以後保存,而後執行source命令,使之生效:bash
userdeMacBook-Pro:~ user$ source .bash_profile userdeMacBook-Pro:~ user$ $PATH -bash: ./usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin:/usr/local/bin:/usr/local/bin:/Users/user/go/bin: No such file or directory
而後進行查看:app
userdeMacBook-Pro:~ user$ go env GOARCH="amd64" GOBIN="/Users/user/go/bin" GOCACHE="/Users/user/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/user/go" GORACE="" GOROOT="/usr/local/Cellar/go/1.10.1/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.10.1/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2_/g5wrlg3x75zbzyqvsd5f093r0000gn/T/go-build566845913=/tmp/go-build -gno-record-gcc-switches -fno-common」
https://store.docker.com/editions/community/docker-ce-desktop-macui
打開,此時電腦右上角就會出現一個相似鯨魚的圖標:
阿里雲
在運行Hyperledger Fabric時,請確保Docker處於開啓狀態:spa
而後就能查看出版本號了:debug
userdeMBP:~ user$ docker version Client: Version: 18.03.1-ce API version: 1.37 Go version: go1.9.5 Git commit: 9ee9f40 Built: Thu Apr 26 07:13:02 2018 OS/Arch: darwin/amd64 Experimental: false Orchestrator: swarm Server: Engine: Version: 18.03.1-ce API version: 1.37 (minimum version 1.12) Go version: go1.9.5 Git commit: 9ee9f40 Built: Thu Apr 26 07:22:38 2018 OS/Arch: linux/amd64 Experimental: true
userdeMBP:~ user$ docker-compose --version docker-compose version 1.21.1, build 5a3f1a3
Mac電腦配置docker阿里雲加速器時,preferences-daemon-register mirrors 中寫上加速器地址,寫的是別人的,可是也能夠本身去申請。3d
老是提示code
"registry-mirrors" : No certs for ic2v8yz.mirror.aliyuncs.com
解決辦法:將https改成http,而後在點擊Apply&Restart就行了
可是後面發現運行./download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0 仍是出錯了:
userdeMacBook-Pro:e2e_cli user$ ./download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0 Pull CA IMAGES Pull FABRIC TAG ===> Pulling fabric Images ==> FABRIC IMAGE: peer Warning: failed to get default registry endpoint from daemon (Error response from daemon: Bad response from Docker engine). Using system default: https://index.docker.io/v1/ Error response from daemon: Bad response from Docker engine
而後後面查,緣由是:
從docker1.3.2版本開始默認docker registry使用的是https,當你用docker pull 非https的docker regsitry的時候會報下面錯誤,因此上面的更改是錯誤的,不該該改爲http
而後我就忽然想起,最最開始爲https的時候我沒有點擊apply&Restart,因此下載鏡像的時候沒能用上阿里雲,因此下載timeout。
"registry-mirrors" :這個問題是能夠忽略不計的,而後我點擊apply&Restart後,再從新運行./download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0就成功了
這時候得出來的信息就是以前沒下載完的鏡像:
userdeMacBook-Pro:e2e_cli user$ ./download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0 Pull CA IMAGES Pull FABRIC TAG ===> Pulling fabric Images ==> FABRIC IMAGE: peer x86_64-1.0.0: Pulling from hyperledger/fabric-peer Digest: sha256:b7c1c2a6b356996c3dbe2b9554055cd2b63194cd7a492a83de2dbabf7f7e3c65 Status: Image is up to date for hyperledger/fabric-peer:x86_64-1.0.0 ==> FABRIC IMAGE: orderer x86_64-1.0.0: Pulling from hyperledger/fabric-orderer Digest: sha256:d0ea1f7e7ca04f0c4b7484f8835fd68e9bf13e6fcb700cf3a70f00a4059fc344 Status: Image is up to date for hyperledger/fabric-orderer:x86_64-1.0.0 ==> FABRIC IMAGE: couchdb x86_64-1.0.0: Pulling from hyperledger/fabric-couchdb ........