Posts

Showing posts with the label Docker

Packer to Create Docker

Image
It is simple to create Docker from Packer. In this example I will show you how to create open JDK 8 installed Docker image. First you have to create a packer.json file: { "builders": [ { "name": "docker", "type": "docker", "image": "centos:7", "commit": true } ], "provisioners": [ { "type": "ansible", "playbook_file": "playbook.yaml" } ], "post-processors": [ { "type": "docker-tag", "repository": "ojitha/java8", "tag": "0.0.1" } ] } Here the playbook.yaml which will provision the docker instance: --- - hosts: all tasks: - name: message debug: msg="Container - {{ inventory_hostname }} running {{ ansible_distribution }}" - name: install the latest version of open jdk...

Hands dirty with Kubernetes

Image
The smallest entity Kubernetes can manage is pod: specification of how to run the containers. The pod have network and the storage. Identical Pods can be in a collection called replicas set. Replicaset guarantee the availability of the deployment. However, Kubernetes cannot handle services as well as deployment. Through the services, deployment is exposed. Same Kubernetes host, there can be number of Pods, the namespace define the group of pods belongs to each other: guarantee the secure environment. Architecture . Following are running in the very well defined processes Head Node Worker Node Head Node API server scheduler- Place the containers where need to go Controller Manager- state of the system Etcd-Data store to store the state Kubelet docker Worker Node Kubelet is Kubenetes agent runs on all the cluster nodes Talks to API and local docker demon to manage the docker containers. Kube-proxy manage the trafie of the PODS and the node docker Install ...

Hands dirty with Docker

Image
To install the docker machine in the AWS: #for the default docker docker-machine create --driver amazonec2 aws01 #for the custom centos docker-machine create --driver amazonec2 --amazonc2-region ap-southeast-2 --amazonec2-ami ami-0c2aba6c -amazonec2-ssh-user ojitha aws-demo If you run the above default (in the N. virginia region), here the way to set the env ~ docker-machine env aws01 #output is : export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://54.173.183.175:2376" export DOCKER_CERT_PATH="/Users/ojitha/.docker/machine/machines/aws01" export DOCKER_MACHINE_NAME="aws01" # Run this command to configure your shell: # eval $(docker-machine env aws01) #for the custom #eval $(docker-machine env aws-demo) For example, to run a simplest docker container ~ docker run --name hello-A dockerinaction/hello_world Unable to find image 'dockerinaction/hello_world:latest' locally latest: Pulling from dockerinaction/hello_world a3ed95ca...