Skip to content

Instantly share code, notes, and snippets.

Whalify Yourself !

Ajeet Singh Raina, Docker Captain, {Code} Catalysts, Dell EMC R&D ajeetraina

Whalify Yourself !
Block or report user

Report or block ajeetraina

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:484f506e26d689b48b4dbef1f06943c3
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 consul://
View Getting Started with Docker
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...)
View gist:00fc74ec1687a015fc01b3ad4b93c0bb
Day - 6/29/2016
1. Installing Docker
#apt-get install docker*
2. Checking the version
#docker version
View Swarm Mode using Docker-machine
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...
View gist:1b9fbb69509e84c72811cbb75fcffff0
$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}}' \
View gist:c4be983c3a3c6b31d99498ff3b155d44
`--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
ajeetraina / gist:6831a5e2e7c6e4955f1a4af8b7693293
Last active Sep 25, 2016
Testing Node Labels under Docker 1.12 Swarm Mode
View gist:6831a5e2e7c6e4955f1a4af8b7693293
Platform: Google Cloud
Docker Version: 1.12.1
Setting up Master-1:
master ==>sudo docker swarm init --listen-addr
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 \
View Getting Started with Infrakit
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/
cd !$
ajeetraina / gist:1cc2213789c0ff7923d9dc06fbbc63d5
Created Oct 28, 2016
Testing Docker-Compose for MongoDB & Node.js
View gist:1cc2213789c0ff7923d9dc06fbbc63d5
sudo docker run -d --name mdb5 mongo
sudo docker ps
adc6dda648fa mongo "/ mongo" 36 seconds ago Up 35
seconds 27017/tcp mdb5
$ sudo docker run -p 27017:27017 --name db --link mdb5:mdb5 mongo
View gist:7e55ad73bb8340fa15e981a1fdb89c96
$ 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"
You can’t perform that action at this time.