这是我的撰写文件定义
cli:
container_name: cli
image: hyperledger/fabric-tools:$IMAGE_TAG
tty: true
stdin_open: true
environment:
- GOPATH=/opt/gopath
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: /bin/bash
volumes:
- ./chaincode/:/opt/gopath/src/github.com/chaincode
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
我希望本地文件夹chaincode
与容器路径/opt/gopath/src/github.com/chaincode
为此,我尝试了此命令
docker run -v ./chaincode/:/opt/gopath/src/github.com/chaincode hyperledger/fabric-tools
docker run -i -t -volumes-from hyperledger/fabric-tools bash
但这仍然会在容器中提供空目录