title: Docker unknown flag: --network
body: <p>I want to share my host with container.</p>
  <p>I already have some services running in containers, e.g. Redis.</p>
  <p>I want to run another app in another container. The app expects that Redis is listening on localhost:6379.</p>
  <p>From my host machine, I have an access to that port, because I have a port mapping from the Redis-container port to the host port.</p>
  <p>I want my app container to have access to the same ports and networks that my host machine has.</p>
  <p>I tried this command: <code>docker --network=host run somecontainer</code> but got <code>unknown flag: --network</code> so no success. <a href="https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach">SO question</a>, <a href="https://docs.docker.com/engine/reference/run/#network-host" rel="nofollow noreferrer">Docker docs</a>.</p>
  <p>How else I can achieve the behavior described above? Host localhost = container localhost</p>