title: How to change the network of a running docker container?
body: <p>I'm trying to update the network of a running docker container.</p>
  
  <p>Note: I didn't attach any network while running the container.</p>
  
  <pre><code>[root@stagingrbt ~]# docker network connect host cdf8d6e3013d
  Error response from daemon: container sharing network namespace with another container or host cannot be connected to any other network
  
  [root@stagingrbt ~]# docker network connect docker_gwbridge cdf8d6e3013d
  error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/networks/docker_gwbridge/connect: EOF
  
  
  [root@stagingrbt ~]# docker network create -d host my-host-network
  Error response from daemon: only one instance of "host" network is allowed
  
  
  [root@stagingrbt ~]# docker network ls
  NETWORK ID          NAME                DRIVER              SCOPE
  495080cf93e3        bridge              bridge              local
  cf0408d6f13f        docker_gwbridge     bridge              local
  2c5461835eaf        host                host                local
  87e9cohcbogh        ingress             overlay             swarm
  84dbd78101e3        none                null                local
  774882ac9b09        sudhirnetwork       bridge              local
  </code></pre>