Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ajeetraina's full-sized avatar
💭
Whalify Yourself !

Ajeet Singh Raina, Docker Captain, ARM Innovator, ajeetraina

💭
Whalify Yourself !
View GitHub Profile
@ajeetraina
ajeetraina / gist:551f56eafb141e8670552fae06e0c5a2
Last active November 19, 2016 01:42
Demonstrating Swarm Mode under Azure Platform
Contents:
1. Pre-requisite
2. Machine Setup
3. Setting up Master Node
4. Setting up Worker Nodes
5. Creating our First Service
6. Inspecting the Service
7. Scaling the Service
8. Creating a Nginx Service
@ajeetraina
ajeetraina / gist:8d18feca9a1711c5d9fcd42638e5d61b
Created November 24, 2016 02:38
Preparing MongoDB Container
Dockerfile:
FROM ubuntu:16.04
MAINTAINER Ajeet S Raina <ajeetraina@gmail.com>
ENV MONGO_USER=mongodb \
MONGO_DATA_DIR=/var/lib/mongodb \
MONGO_LOG_DIR=/var/log/mongodb
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 \
2016-11-25 Status Type Logical ID Status reason
15:37:47 UTC+0550 DELETE_COMPLETE AWS::EC2::Subnet PubSubnetAz1
15:37:31 UTC+0550 DELETE_IN_PROGRESS AWS::EC2::SecurityGroup ExternalLoadBalancerSG
15:37:31 UTC+0550 DELETE_IN_PROGRESS AWS::EC2::Subnet PubSubnetAz2
15:37:31 UTC+0550 DELETE_IN_PROGRESS AWS::EC2::Subnet PubSubnetAz1
15:37:31 UTC+0550 DELETE_IN_PROGRESS AWS::EC2::VPCGatewayAttachment AttachGateway
15:37:29 UTC+0550 DELETE_COMPLETE AWS::ElasticLoadBalancing::LoadBalancer ExternalLoadBalancer
15:37:29 UTC+0550 DELETE_IN_PROGRESS AWS::ElasticLoadBalancing::LoadBalancer ExternalLoadBalancer
15:37:27 UTC+0550 DELETE_COMPLETE AWS::DynamoDB::Table SwarmDynDBTable
15:37:09 UTC+0550 DELETE_COMPLETE AWS::EC2::RouteTable RouteViaIgw
@ajeetraina
ajeetraina / gist:cc20f1942051eee38d0fa42a0e8e024e
Created November 26, 2016 02:25
Docker for AWS Beta Testing
2016-11-26 Status Type Logical ID Status reason
07:53:36 UTC+0550 ROLLBACK_COMPLETE AWS::CloudFormation::Stack Docker
07:53:35 UTC+0550 DELETE_COMPLETE AWS::EC2::VPC Vpc
07:53:19 UTC+0550 DELETE_IN_PROGRESS AWS::EC2::VPC Vpc
07:53:18 UTC+0550 DELETE_COMPLETE AWS::EC2::Subnet PubSubnetAz1
07:52:04 UTC+0550 DELETE_COMPLETE AWS::EC2::SecurityGroup ExternalLoadBalancerSG
07:51:58 UTC+0550 DELETE_COMPLETE AWS::EC2::InternetGateway InternetGateway
07:51:42 UTC+0550 DELETE_IN_PROGRESS AWS::EC2::InternetGateway InternetGateway
07:51:40 UTC+0550 DELETE_COMPLETE AWS::EC2::VPCGatewayAttachment AttachGateway
07:50:59 UTC+0550 DELETE_COMPLETE AWS::SQS::Queue SwarmSQS
@ajeetraina
ajeetraina / gist:67c0177061be3113e60db027747633b9
Created November 27, 2016 15:03
Trying out Service Logging under Docker 1.13
root@Master1:~# docker service scale redis=5
redis scaled to 5
root@Master1:~# docker service logs redis
redis.1.dd53bhhvvh2x@Node1 | 1:C 27 Nov 14:58:18.861 # Warning: no config file specifiredis-server /path/to/redis.conf
redis.1.dd53bhhvvh2x@Node1 | _._
redis.1.dd53bhhvvh2x@Node1 | _.-``__ ''-._
redis.1.dd53bhhvvh2x@Node1 | _.-`` `. `_. ''-._ Redis 3.2.5 (0000
redis.1.dd53bhhvvh2x@Node1 | .-`` .-```. ```\/ _.,_ ''-._
redis.1.dd53bhhvvh2x@Node1 | ( ' , .-` | `, ) Running in standa
redis.1.dd53bhhvvh2x@Node1 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
@ajeetraina
ajeetraina / gist:abd382857b966fe865139ea51eef32b7
Last active December 5, 2016 11:41
Setting up RexRay with ScaleIO for Docker 1.13
Setup:
======
ScaleIO:
3 node cluster
Gateway: 10.94.214.180 (Master MDM)
SDC: 10.94..214.181 (Slave MDM)
TB: 10.94.214.179 ( Tie Breaker)
root@mdm-2:~/test# docker run -it --rm --entrypoint /opt/discover.sh ajeetraina/testing2
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
@ajeetraina
ajeetraina / gist:54ba9f567b3e273af93f240644451252
Created December 20, 2016 07:47
Installing Docker on UEK Kernel
[root@localhost ~]# curl -sSL https://test.docker.com/ | sh
+ sh -c 'sleep 3; yum -y -q install docker-engine'
Error: Package: docker-engine-1.13.0-0.4.rc4.el6.x86_64 (docker-testing-repo)
Requires: kernel-uek >= 4.1
Installed: kernel-uek-3.8.13-16.2.1.el6uek.x86_64 (@anaconda-UEK3/6.5)
kernel-uek = 3.8.13-16.2.1.el6uek
kernel-uek = 3.8.13-16.2.1.el6uek
Installed: kernel-uek-3.8.13-118.15.1.el6uek.x86_64 (@public_ol6_UEKR3_latest)
kernel-uek = 3.8.13-118.15.1.el6uek
kernel-uek = 3.8.13-118.15.1.el6uek
@ajeetraina
ajeetraina / gist:f6f2336b221ede53e2f73f8fcef37fd7
Last active December 25, 2016 07:44
Example of Swarm Mode: Testing Simple Web Application
Setup:
ajeetsraina81@ucp-1:~$ sudo docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
8szgdxh310tkad373ourepch8 worker5 Ready Active
e2xjlg4610mmyym98sk91qu43 worker1 Ready Active
is52hxuxlrcclwd6hbujvflao worker2 Ready Active
nnnofsbqqbprgp4m4tw2oh2z1 worker4 Ready Active
sv2uuuy3spbh9oriue0mnyx83 * ucp-1 Ready Active Leader
sx1c598mlz6r6hg6zrbamrpsn worker3 Ready Active
sudo sed -i '/^ExecStart=/ s/$/ $DOCKER_OPTS/' /lib/systemd/system/docker.service &&
sudo sed -i '9i EnvironmentFile=/etc/default/docker' /lib/systemd/system/docker.service && sudo sed -i '14i DOCKER_OPTS="--experimental"' /etc/default/docker && \
sudo systemctl daemon-reload && \
sudo systemctl restart docker.service