hyperledger / hyperledger/fabric-private-chaincode

Docker dev container not working properly with net host mode on mac

Open
#437 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
174
Forks
98
Avg merge
2d 21h
Merged PRs (30d)
1

Description

**Describe the bug**

Currently we start the FPC docker dev container with `--net host` as set in `utils/docker/Makefile` to allow easy access to services (e.g. demo mock server and other docker-compose based tests). This seems to work fine on Linux but is not supported for Mac.

For instance, when starting the demo mock server on port 5000, this is not reachable via browser from the host Mac system.

> The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.

See [Use host networking](https://docs.docker.com/network/host/) at docker docs.

**To Reproduce**
On a Mac
```
cd $FPC_PATH/utils/docker
make run
```
inside the container
```
make
cd $FPC_PATH/demo/client/backend/mock/
make run-fpc
```

**Expected behavior**
open a browser and check localhost:3000; and you should see `404 page not found` error. 404 shows that the web service inside the container can be accessed from the host.

**Environment (please complete the following information):**
- OS: Mac
- FPC Version: master

**Workaround**

Start the container without `--net=host` and add port mapping using `-p 3000:3000`.

@g2flyer Can we change `DOCKER_DEV_RUN_OPTS` in a way that the use of `--net=host` can be controlled easily though `config.override.mk`? Or just remove `--net=host` as default?

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.