diff mbox series

[1/2] utils/docker: use host's network setup

Message ID 68133ee58ba7da20be579110a95d6413a49c4049.1698747732.git.yann.morin@orange.com
State Accepted
Headers show
Series [1/2] utils/docker: use host's network setup | expand

Commit Message

Yann E. MORIN Oct. 31, 2023, 10:22 a.m. UTC
From: "Yann E. MORIN" <yann.morin@orange.com>

Our utils/docker-run wrapper is needed to provide a reproducible build
environment: tools, variables, etc... but is not meant for isolation. As
such, we do not care what the network configuration is used.

In some settings (e.g. enterprise networks), it is often the case that a
VPN is in use, especially in those wonderful times of widespread remote
work.

Letting Docker decide on the network setup, will most usually lead to it
creating a private network that is NATed onto the principal network
interface, leading to non-functional network in the container when a VPN
is in use.

As such, always use the host network configuration, and do not let
Docker create a private network for the container.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Ricardo Martincoski <ricardo.martincoski@datacom.com.br>
---
 utils/docker-run | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/utils/docker-run b/utils/docker-run
index 848e9b3840..464cbf691f 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -21,6 +21,7 @@  declare -a docker_opts=(
     --user "$(id -u):$(id -g)"
     --workdir "$(pwd)"
     --security-opt label=disable
+    --network host
 )
 
 declare -a mountpoints=(