- this is very useful if you have an app image that needs to communicate w/ 1 or more other containers (things like a web server, database(s), other app servers, etc)
-
Run container w/ a name using cmd line switch
docker run -d --name {container-name} {image-name}
-
Link to running container by name
docker run -d -p 5000:5000 --link {other-container-name}:{alias-inside-container} {image-name}
-
Repeat for additional containers
Creates an isolated network of containers. Containers can access any other container (by name) within the network.
- Create custom bridge network
docker network create --driver bridge {network_name}
- Run containers in network (make sure they have their own name)
`docker run -d --net={network_name} --name {container-name} {image-name}