-----------------------------------------------------------------------------------------------------------------------------------------------------
Linking containers

$ sudo docker run --rm --name example -it busybox:latest

# cat /etc/hosts

# env

$ sudo docker run --rm --link example:ex -it busybox:latest

# cat /etc/hosts

# env

# ping -c 2 ex

$ sudo docker build -t envex .

$ sudo docker run -it --rm \
--name example envex

# env

# env

$ sudo docker run --rm --link example:ex \
busybox:latest env

$ sudo docker build -t portex .

$ sudo docker run -it --rm \
--name example portex

$ sudo docker run --rm --link example:ex \
busybox:latest env
-----------------------------------------------------------------------------------------------------------------------------------------------------
Orchestration of containers

Installing docker-compose

$ sudo sh -c 'wget -qOhttps://github.com/docker/compose/releases/download/1.2.0/
docker-compose-'uname -s'-'uname -m' > /usr/local/bin/dockercompose; chmod +x /usr/local/bin/docker-compose'

$ sudo sh -c 'curl -sSL
https://github.com/docker/compose/releases/download/1.2.0/
docker-compose-'uname -s'-'uname -m' > /usr/local/bin/docker
compose; chmod +x /usr/local/bin/docker-compose'

$ sudo pip install -U docker-compose

$ docker-compose --version
-----------------------------------------------------------------------------------------------------------------------------------------------------
Common usage


$ cd ~/example

$ sudo docker-compose build

$ sudo docker-compose up

$ sudo docker-compose ps

$ curl http://0.0.0.0:8080

$ curl http://0.0.0.0:8080/build

$ curl http://0.0.0.0:8080/something

-----------------------------------------------------------------------------------------------------------------------------------------------------
