Allow to pass flags to `docker run`
sungwoncho opened this issue · comments
It would be useful to be able to pass a flag to docker run
.
A use case is passing flags such as --net=host
to be able to access the Internet from inside a docker container. I had a case in which xgo was failing because it could not fetch go modules for a project due to some DNS-related issue preventing the Internet from being available inside a container. The error was something like:
go: github.com/Azure/azure-pipeline-go@v0.2.2: Get https://proxy.golang.org/github.com/%21azure/azure-pipeline-go/@v/v0.2.2.mod: dial tcp: lookup proxy.golang.org on 8.8.4.4:53: read udp 172.17.0.2:452 598->8.8.4.4:53: i/o timeout
I have managed to bypass it by forking the project, and adding "--net", "host"
to
Lines 284 to 301 in c5ccff8
What do you think about adding a flag in xgo
such as -dockerflag
? I am happy to make a PR.