Skip to content

Instantly share code, notes, and snippets.

View potikanond's full-sized avatar

D. Potikanond potikanond

  • Computer Engineering, CMU
  • Thailand
View GitHub Profile
@potikanond
potikanond / README.md
Last active August 26, 2018 15:12
Example: DNS round-robin

Example: DNS round-robin

This mechanism can be use for loadbalancing web application

Here we will implement load balance 'Elasticsearch". What is Elasticsearch?

Create a virtual network and two elasticsearch containers with the same 'alias name'

$ docker network create dude
$ docker container run -d --net dude --net-alias search elasticsearch:2
@potikanond
potikanond / README.md
Last active August 26, 2018 15:13
Ex2.5: Multiple virtual docker network

Ex2.5: Multiple virtual docker network

Create 'my_web_net' and 'my_api_net' virtual network

$ docker network create my_web_net $ docket network create my_api_net $ docker network ls sample output:

@potikanond
potikanond / README.md
Last active August 26, 2018 15:15
Ex2.4: Docker Network

Ex2.4: Docker Network

List all docker networks

$ docker network ls

** sample output **

NETWORK ID NAME DRIVER SCOPE
@potikanond
potikanond / README.md
Last active August 26, 2018 15:15
Ex2.3: Ubuntu shell and CURL installation

Ex2.3: Ubuntu shell and CURL installation

Start Ubuntu Xenial container

$ docker container run -d -it --name my_ubuntu ubuntu:xenial

Inside Ubuntu container, update and install CURL

Note: make sure the DNS works fine in the container.

@potikanond
potikanond / README.md
Last active August 26, 2018 15:16
Ex2.2: Alpine linux container

Ex2.2: Alpine linux container

Start alpine linux container, use 'Ctrl+pq' to exit without stopping container

$ docker container run -it --name my_alpine alpine sh

Reattach to the running container

$ docker container attach my_alpine

@potikanond
potikanond / README.md
Last active August 26, 2018 15:18
Ex2.1: Multiple containers - docker commands

Ex2.1: Multiple containers - docker commands

Start nginx container

$ docker container run -d --name my_proxy -p 80:80 nginx:alpine

Start apache container

$ docker container run -d --name my_web -p 8081:80 httpd:alpine