Created by Linh Tran
A set of native orchestration services with the ambition to cover the entire devops flow from local box to big cluster in the cloud!
Sound intimidating?
The good news is that even for a every day developer, these tools can still easily applied and make the earth a little better place
No need to use all of Compose, Machine, Swarm together. Use whatever tools and combinations you needs.
Everything is alpha & beta. Prepare to sweat a litter!
$ docker run -d -it --name redis redis
$ docker run -d -it --name postgres linhmtran168/postgres
$ docker run -d -it --name web \
-v ~/Dev/gitlab.com/linhmtran168/test-project:/var/www/html \
--link postgres:db --link redis:redis linhmtran168/php-web
$ docker run -d -it -p 80:80 --name nginx \
--link web:web --volumes-from web linhmtran168/php-nginx
$ docker run -d -it --name node --link web:web \
--volumes-from web linhmtran168/gulp-bower
$ docker-compose upWith Compose, you define all your containers configuration in a yml file
...
web:
build: .
links:
- redis:redis
- postgres:db
volumes:
- .:/var/www/html
nginx:
build: ../docker-php-nginx
ports:
- "80:80"
links:
- web:web
volumes_from:
- web
...
$ docker-compose -f test.yml
$ docker-compose --help
Some of interesting ones
$ docker-compose up
$ docker-compose scale web=3
Do I look like a boss?
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
dev virtualbox Running tcp://192.168.99.104:2376
ec2 amazonec2 Running tcp://52.74.133.250:2376
master virtualbox Running tcp://192.168.99.105:2376
swarm-master virtualbox Running tcp://192.168.99.106:2376 swarm-master (master)
swarm-node-1 virtualbox Running tcp://192.168.99.107:2376 swarm-master
swarm-node-2 virtualbox Running tcp://192.168.99.108:2376 swarm-master
Create and manage Docker hosts on your computer, on cloud providers and inside your own data center (in the future), also automate commication with local docker client.
$ export DOCKER_HOST=tcp://192.168.59.103:2376
$ export DOCKER_CERT_PATH=/Users/mary/.boot2docker/certs/boot2docker-vm
$ export DOCKER_TLS_VERIFY=1
$ docker-machine create --driver virtualbox dev
$ docker-machine create -d amazonec2 --amazonec2-access-key "..." \
--amazonec2-secret-key "..." --amazonec2-vpc-id "..." \
--amazonec2-subnet-id "..." --amazonec2-instance-type "t2.small" \
--amazonec2-region "ap-southeast-1" --amazonec2-zone "b"
test-ec2
$ eval "$(docker-machine env dev)" # or test-ec2
Native clustering for Docker. It turns a pool of Docker hosts into a single, virtual host.
$ docker run --rm swarm create
6856663cdefdec325839a4b7e1de38e8 cluster_id
$ docker -H tcp://0.0.0.0:2375 -d
$ docker run -d swarm join --addr=node_ip:2375 \
token://cluster_id
$ docker run -d -p swarm_port:2375 swarm manage \
token://cluster_id
$ docker -H tcp://manager_ip:manager_port your_command
Experimental but much nicer than the mual way
$ docker-machine create -d virtualbox manager
$ eval "$(docker-machine env local)"
$ docker run swarm create
1257e0f0bbb499b5cd04b4c9bdb2dab3 #token
docker-machine create \
-d virtualbox \
--swarm \
--swarm-master \
--swarm-discovery token://token
swarm-master
$ docker-machine create \
-d virtualbox \
--swarm \
--swarm-discovery token://token
swarm-node-1
$ eval $(docker-machine env --swarm swarm-master)