hyperledger / hyperledger/fabric-samples

Multiple minor issues running custom chaincode image on host docker container + Workarounds

Open
#590 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3k
Forks
3.5k
Avg merge
3d 20h
Merged PRs (30d)
6

Description

Hey Team,

I was playing around with custom image of asset-transfer-basic using this tutorial:

https://github.com/hyperledger/fabric-samples/blob/main/test-network-k8s/docs/CHAINCODE.md#build-a-chaincode-docker-image

then

https://github.com/hyperledger/fabric-samples/blob/main/test-network-k8s/docs/CHAINCODE.md#debugging-chaincode

Going with tutorial left some lack that had to be mitigated:
1. `docker run` command should be executed with `-d` to run the container as daemon (point 3. of [this section](https://github.com/hyperledger/fabric-samples/blob/main/test-network-k8s/docs/CHAINCODE.md#debugging-chaincode)):

```shell
$ docker run -d \
--rm \
--name asset-transfer-basic-debug \
-e CHAINCODE_ID \
-e CHAINCODE_SERVER_ADDRESS=0.0.0.0:9999 \
-p 9999:9999 \
localhost:5000/asset-transfer-basic
```

2. There is no communication with the docker host from pods using suggested DNS in [connection.json](https://github.com/hyperledger/fabric-samples/blob/main/test-network-k8s/chaincode/asset-transfer-basic-debug/connection.json) - `host.docker.internal:9999` does not work ([this section](https://github.com/hyperledger/fabric-samples/blob/main/test-network-k8s/docs/CHAINCODE.md#debugging-chaincode)).

As a workaround I simply modified the line to point to the docker host IP:
```shell
{
"address": "192.168.1.10:9999",
"dial_timeout": "10s",
"tls_required": false
}
```

So my question is how does DNS config work, so that the k8s cluster can see the docker host using DNS names?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.