This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Docker Swarm before 1.12rc2: | |
1. Setting up Consul for Docker Swarm | |
sudo docker run --restart=unless-stopped -d -p 8500:8500 -h consul1 progrium/consul -server -bootstrap | |
2. Setting up Swarm Manager to work with Consul | |
docker run -d -p 4000:4000 swarm manage -H :4000 --replication --advertise 10.142.0.2:4000 consul://10.142.0.2:8500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Getting started with Docker: | |
1. First Container | |
root@master1:~# docker run busybox echo hello world | |
hello world | |
What we did? | |
. We used one of the smallest, simplest images available: busybox. | |
• busybox is typically used in embedded systems (phones, routers...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day - 6/29/2016 | |
1. Installing Docker | |
#apt-get install docker* | |
2. Checking the version | |
#docker version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine: Your Laptop | |
Cloud: Google Cloud Engine | |
Open The PowerSHell and start running these commands: | |
$ gcloud auth login | |
$ docker-machine create --driver google --google-project collabnixx-1346 test-master1 | |
$docker-machine ssh test-master1 | |
But it throws garbage value when you try to do backspace... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sudo docker service create --env WORDPRESS_DB_HOST=wordpressdb1 --env WORDPRESS_DB_PASSWORD=collab123 --network collabnet --replicas 4 --name wordpressapp --publish 80:80/tcp wordpress:latest | |
$sudo docker service create --env WORDPRESS_DB_HOST=wordpressdb --env WORDPRESS_DB_PASSWORD=collab123 --network collabnet --replicas 4 --name wordpressapp --publish 80:80/tcp wordpress:latest | |
$sudo docker service create --replicas 1 --name wordpressdb1 --network collabnet --env MYSQL_ROOT_PASSWORD=collab123 --env MYSQL_DATABASE=wordpress mysql:latest | |
$sudo docker service inspect \ | |
--format=='{{json .Endpoint.VirtualIPs}}' \ | |
wordpressapp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hope: | |
`--opt encrypted` flag ~ an optional which enables an additional layer of encryption in the overlay driver for vxlan traffic between containers on different nodes | |
`--subnet` flag ~ specifies the subnet for use with the overlay network. When you don't specify a subnet, the swarm manager automatically chooses a subnet and assigns it to the network. | |
Note - Before you attach a service to the network, the network only extends to manager nodes | |
ingress - This is the overlay network on which all exposed ports exist. As explained below, ingress ports are numbered from 30000 through 32000 (user configurable range) and follow a node port model in which each service has the same port on every node in the cluster. | |
docker_gwbridge - This is the default gateway network. It is the only network with connectivity to the outside. | |
[user-defined overlay] - This is the overlay network that the user has specified that the container should be on. In the example above, it is mynetwork. Note that a container can be on m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Platform: Google Cloud | |
Docker Version: 1.12.1 | |
Setting up Master-1: | |
master ==>sudo docker swarm init --listen-addr 10.140.0.3 | |
Swarm initialized: current node (doc7u22kg42bo9x0zrjbwtk86) is now a manager. | |
To add a worker to this swarm, run the following command: | |
docker swarm join \ | |
--token SWMTKN-1-02u85v6ggoj4em6e5v6rbjemgo9q324i9sced6dqkr54dyh3k8-68mxomvfy0htjbqm51dz60rtl \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps:(I tested it as root user just for quick setup) | |
#cat script-test | |
export PATH=/usr/local/go/bin:$PATH | |
mkdir -p ~/go | |
export GOPATH=!$ | |
export PATH=$GOPATH/bin:$PATH | |
mkdir -p ~/go/src/github.com/docker | |
cd !$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker run -d --name mdb5 mongo | |
adc6dda648fa206736dc5cd1a4f99319244819fdd0cb1c188902034558e6d501 | |
sudo docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATU | |
S PORTS NAMES | |
adc6dda648fa mongo "/entrypoint.sh mongo" 36 seconds ago Up 35 | |
seconds 27017/tcp mdb5 | |
$ sudo docker run -p 27017:27017 --name db --link mdb5:mdb5 mongo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo docker volume inspect virajsingh9sep_volume_with_label | |
[ | |
{ | |
"Name": "virajsingh9sep_volume_with_label", | |
"Driver": "local", | |
"Mountpoint": "/var/lib/docker/volumes/virajsingh9sep_volume_with_label/_data", | |
"Labels": { | |
"alpha": "beta" | |
}, | |
"Scope": "local" |
OlderNewer