title: Does --network=host still connect to the host network when running a Gitlab CI job with the FF_NETWORK_PER_BUILD flag?
body: <p>I am trying to run a test using docker in docker within a Gitlab CI job. My understanding is that enabling the FF_NETWORK_PER_BUILD flag will automatically create a user-defined bridge network that the job runner and all of the created dockers within that job will connect to... but looking at the Gitlab documentation I am slightly confused...</p>
  <p>This page: <a href="https://docs.gitlab.com/ee/ci/services/" rel="nofollow noreferrer">https://docs.gitlab.com/ee/ci/services/</a></p>
  <p>Gives an example of using the <code>docker:dind</code> service with <code>FF_NETWORK_PER_BUILD: &quot;true&quot;</code></p>
  <p>But then when using <code>docker run</code> they still include the <code>--network=host</code> flag.</p>
  <p>Here is the given example:</p>
  <pre><code>  stage: build
    image: docker:19.03.1
    services:
      - docker:dind                    # necessary for docker run
      - tutum/wordpress:latest
    variables:
      FF_NETWORK_PER_BUILD: &quot;true&quot;     # activate container-to-container networking
    script: |
      docker run --rm --name curl \
        --volume  &quot;$(pwd)&quot;:&quot;$(pwd)&quot;    \
        --workdir &quot;$(pwd)&quot;             \
        --network=host                 \
        curlimages/curl:7.74.0 curl &quot;http://tutum-wordpress&quot;
  </code></pre>
  <p>I am trying to ensure that all of my dockers within this job are on their own separate network,
  so does using the <code>--network=host</code> flag in this instance connect the new docker to the host server that the actual job runner is on? Or the per-job network that was just created? In what case would you want to create a per-job network and still connect a new docker to the host network?</p>
  <p>Would appreciate any advice!</p>