I'm trying to access a host port from a docker container running an OCaml stack. When I use the --net=host option when running the container I get the following error
Fatal error: exception # opam-version 1.2.2 (58ef3b8213100953848d362f7120a30356d7f77d)
# os linux
opam: "execvp" failed on --net=host: No such file or directory
The contents of my /etc/hosts file are as follows
127.0.0.1 localhost
127.0.1.1 ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Could someone please explain why I could be getting this error?
EDIT
The docker command I'm using is docker run -it <repo-name> --net=host