Coder Social home page Coder Social logo

bb-docker's Introduction

bb-docker

Demo during the Brown Bag session about Docker

Prerequisites

Docker engine and docker-machine installed on Ubuntu 16.04 LTS

Virtualbox installed on your laptop or an account on DigitalOcean

Steps to run the demo

Clone the repo

git clone https://github.com/benfab/bb-docker.git

Deploy the Swarm Cluster

Virtualbox

./create-swarm.sh --driver virtualbox --manager 3 --worker 1

Digitalocean

./create-swarm.sh --driver digitalocean --digitalocean_token <token> --manager 3 --worker 5

Check the Swarm cluster

docker-machine ls

eval "$(docker-machine env <node-name>)"

docker node ls

docker swarm join-token worker

docker swarm join-token manager

Revoke a node certificate

docker-machine regenerate-certs <node-name>

Deploy dockercoins and check the status

cd dockercoins

docker stack deploy --bundle-file dockercoins.dab dockercoins

docker service ls

docker stack ps dockercoins

Expose the port 8000

docker service update dockercoins_webui --publish-add 8000:80

Scale-up the dockercoins service and see the hash speed increasing

docker service scale dockercoins_worker=3

Check the network

docker network ls

Deploy a new service called debug

docker service create --name debug --network dockercoins_default --mode global busybox sleep 1000000

docker ps

docker exec -it <container-id> sh

Resolve the dockercoins_worker service Virtual IP

nslookup dockercoins_worker

Resolve the dockcoins_worker tasks IPs

nslookup tasks.dockercoins_worker

Update the service dockercoins_worker

With the flags specified, 2 tasks will be updated at a time with a delay of 10 seconds between the tasks updates

docker service update dockercoins_worker --update-parallelism 2 --update-delay 10s --image benfab/dockercoins_worker:v0.1

Drain a node

docker node ps <node-name>

docker node update <node-name> --availability drain

check if the tasks have been rescheduled

docker service ps dockercoins_hasher

delete the cluster

cd ..

./delete-swarm.sh

bb-docker's People

Contributors

benfab avatar

Watchers

 avatar

Forkers

bottkars

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.