Docker撰写:将主机文件夹与容器文件夹Docker同步

时间:2020-01-30 12:49:00

标签: docker docker-compose

这是我的撰写文件定义

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

但这仍然会在容器中提供空目录

0 个答案:

没有答案