Docker Community Forums

Share and learn in the Docker community.

Change container network


(Radiatejava) #1

I have a problem. I had initially created some containers using ‘docker create --net …’ command and kept them under a custom mynetwork. Now, I need to migrate the containers to a different network without creating a fresh new container. How can I do this ?


(Thiago Lima) #2

I don’t think you can. If your container was properly built properly you should be able to remove it and then create again with no hassle since the important data is being stored on a volume on the host and, thus, it isn’t ephemeral, you have stored (into the host at least or onto dockerhub) a backup of the image used to lauch this container and you have only one process being run at this container.