In my opinion, the CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
setting seems to be wrong.
you can check docker-compose.yaml
or core.yaml
1. docker-compose.yaml
- I will explain fabric-samples/test-network as targeting according to your current situation.
- You can check in
CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
in docker-compose.yaml
- Perhaps in your case(fabric-samples/test-network), the value of
${COMPOSE_PROJECT_NAME}
was not set properly, so it was set to _test
.
- Make sure the value is set correctly and change it to your network name.
# hyperledger/fabric-samples/test-network/docker/docker-compose-test-net.yaml
# based v2.2
...
peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer:2.2
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
# - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_test
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=docker_test
...
2. core.yaml
If you have not set the value in the docker-compose.yaml
peer, you need to check the core.yaml
referenced by the peer.
you can find the networkMode
parameter in core.yaml
# core.yaml
...
vm:
docker:
hostConfig:
# NetworkMode: host
NetworkMode: docker_test
...
If neither is set, it will be set to the default value. However, as you see _test
being logged, the wrong value have been set in one of the two section, and you need to correct the value to the value you intended.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…