Detail discussion on Dockers and LXC

LXC  is technology which can replace the Virtual machines like virtualbox and vmware in terms of  deploying os for developers to provide them a plateform.

We will learn ton of things  named  below.

1.  linux containers

here we will discuss about  kernel namespace , cgroups , capabilities etc.

2.  Docker engine 

Here we will discuss about   execution drivers libcontainers vs LXC
and
AUFS , overlayFS , Device Mapper


3.   docker images 

here docker images builds ,  docker create , docker inspect and many more


4.   docker contianers 

docker start and stop , restart 


Now Installation  process of docker .

Requirement:  

i)   RPM based any operating system generally used redhat/centos

OR

II)  deb  based any operating system i am using  ubuntu 14.04

iii)  kernel must docker supportable that is 3.10 or +


NOTE:  you can find some live repository for installing dockers.


Note:  To install dockers

For  ubuntu 
root@ashulinux:~# apt-get  install docker

For Redhat 

root@ashulinux:~# yum  install  docker-io  

root@ashulinux:~# yum  install docker 


@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

Now its time for getting started with dockers and LXC 

1.  To check the version of docker

root@ashulinux:~# docker  -v
Docker version 1.7.0-dev, build 5e06332


2.    To check more infor about dockers that is  drivers and storage all the things


root@ashulinux:~# docker  info
Containers: 25
Images: 23
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 73
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-63-generic
Operating System: Ubuntu 14.04.3 LTS
CPUs: 4
Total Memory: 5.632 GiB
Name: ashulinux
ID: BXSF:5EO3:FPFM:FO3G:2GKG:K76T:J5SW:ADIX:EYOS:EHKQ:7OTY:L74M
WARNING: No swap limit support
root@ashulinux:~# 


Important:  Docker run upon  unix socket which is  located  at  /var/run/docker.sock

3.  docker can run it two style 

A)  as unix socket   from  /var/run/docker.sock

service docker  start

B)   as a IP:port combination  

docker  -H  192.168.0.7:2375  -d 

Note :  To connect  from remote machine  
use : 
export DOCKER_HOST="tcp://192.168.0.7:2375"


4.   searching images of  different operating system in docker online hub

root@ashulinux:/var/run# docker search  ubuntu



Important : how to start container based os

i)  check  the images available  for your test

root@ashulinux:~# docker  images

root@ashulinux:~# docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
centos7http               latest              e00ed0e878b6        4 weeks ago         272.5 MB
centos                    latest              0f73ae75014f        12 weeks ago        172.3 MB

nagar                     latest              cfdf6dcd45b9        3 months ago        202.6 MB


root@ashulinux:~#  



ii)  now start any given images


root@ashulinux:~#  docker  run -it  centos7http /bin/bash

Comments

Post a Comment