Category Archives: Cost Control

1. Cloud Defects:How the Cloud Professionals can Create the costly defects and the reasons ?

With reference to the booming Cloud Market [refer to some of my videos/blogs] and the Conversions to Cloud by different business organizations; Globally millions of IT professionals were mandated to learn the Cloud technologies to sustain their jobs in IT.

When we talk about these converted IT Professionals, they were forced to move into Cloud due to the sustainability of their job.

At the same time their employers are also enforced by their management to accelerate the cost savings for IT infra.

So how they do the planning for Cloud ?

On top there can be a CTO/CIO plans it to convert into Cloud. And they have the complete knowledge of the infrastructure with reference to their technology being used for business systems.

There will be Cloud Architects, they are responsible to create the Cloud implementation design.

Then the plan and the design is released to the Cloud engineers by allocating the tasks.

In between due to lack of [turn around] time, the Cloud engineers are pressured to create the environments. Here everybody can find one point, the management did not plan the knowledge transfer perfectly to the low level people. Then they can create many costly defects as per their knowledge and experience. So there is no ‘uniformity was followed’ in this case. It need not be a cost effective solution the Cloud Architects or Cloud Engineers have done. And there was no review also done. Once the monthly Cloud bill is arrived they will realize on it. Then they can realize the costly burning/bill happened by comparing to their planned cost saving on Infra. So this way they are enforced to track the resources who created these costly defects.

The following picture has got this kind of analysis. And what are the basic reasons the Architects and Engineers are not able to understand the domain conversion scenarios, when the management plans and release it for implementation.

Here we need to remember, every IT Professional need to realize that one fine day the current size of the resources will not be there in any project due to Cloud and the automation implementation is happening.

So the self matured professional need to realize where they are lacking and step down to learn those from experts, on war footing basis to prove and safeguard their jobs in IT.

You can watch the discussion from:

5. Cloud Defects:What could be the Reasons for traditional networks design defects – towards conversion into VPC ? [A video Discussion]

3. Cloud Defects:What kind of defects/extra work can be created without bootstrapping or IAC followed ?

2. Cloud Defects:What kind of defects can be created without session management in ELB/Cloud ?

4. Cloud Defects:What could be the reasons for Costly defects ? [A video Discussion]

If you want to learn the details, I have discussed in the below video with the relevant coaching on AWS-SAA course also.

https://business.facebook.com/vskumarcloud/videos/642868796242922/

Also go through the below blog to know the Cloud and DevOps Roles:

https://vskumar.blog/2018/12/30/how-a-cloud-architect-is-different-from-devops-role/

To know the real practices lacking and the root causes towards creating these costly defects, visit the below video based blog. It can show the ways to improve your Cloud projects ROI.

https://vskumar.blog/2019/10/30/4-cloud-defectswhat-could-be-the-reasons-for-costly-defects/

Also visit my video on How to Initiate Cloud Conversion with some best practices:
https://www.youtube.com/watch?v=98zboBaXgoU&t=379s

1. Cloud architect: How to build your Infrastructure planning practice [watch many scenario based videos] ?

If you are a Cloud Architect, you might do project initiation for Cloud migration projects. During that time you need to have a plan to get series of activities and to make a project schedule. You might need to see this discussion Video also along with your planning. It will add value for your future efforts savings or can reduce repeat activities. Please send your feedback by e-mail [mentioned in it], which can encourage us to make such Consulting/discussion videos sharing on Social.

Build Cloud architects-FB promotion

With reference to my previous blog on the role of Cloud architect, in this blog I would like to present on:

  • What is Traditional Infrastructure planning and building analysis ?

  • How to setup a new Infrastructure for an E-commerce [simple site] in Traditional manner ?

  • What are the Activities we might do ?

  • How to compare them in high level with a Cloud Architecting ?

  • If the Cloud architect apply these practices in his/her area, lot of time for roll back/back out tasks can be reduced during migration.

The following One hour Video has the entire elaboration  for your clarity with a Consulting/Training discussion:

You can also join for similar discussions:

https://www.facebook.com/groups/1911594275816833/about/

If you are looking for coaching on your role Cloud performance, please contact me on my FB with your Linkedin URL.

For details on my coaching visit:

https://vskumar.blog/2018/11/13/coaching-mentoring-on-aws-solution-architect-associate-exam/

If you are interested to know the Cloud initiation activities, visit my video:

A scenario based discussion happened with a Cloud professional from the above video/blog:

Cloud Initiation and Practices – 1:

https://www.facebook.com/101806851617834/videos/336263767430087/

Cloud Initiation and Practices – 2:
This is the 2nd discussion video on the Cloud initiation and on the needed practices.

11. DevOps: How to Launch a container as a daemon ?

Docker-logo

In continuation of my previous blog on “10. DevOps: How to Build images from Docker containers?”, I am continuing my lab exercises. In this session we can see ”

How to Launch a container as a daemon ?:

Note: If you want to recollect the docker commands to be used during your current lab practice, visit my blog link:

https://vskumarblogs.wordpress.com/2017/12/13/some-useful-docker-commands-for-handling-images-and-containers/

 

Let us recap the past exercises; So far we have experimented with an interactive container, tracked the changes that were made to the containers., created images from the containers, and then gained insights in the containerization scenarios.

Now, let us see the container usage in a detached mode.

When we run the container in a detached mode it runs under a daemon process.

I want to use the “ubuntu” image and run detached mode command.

First, let me check my current docker images:

==================>

vskumar@ubuntu:~$

vskumar@ubuntu:~$ sudo docker images

[sudo] password for vskumar:

REPOSITORY TAG IMAGE ID CREATED SIZE

docker-exercise/ubuntu-wgetinstall latest e34304119838 7 days ago 169MB

<none> <none> fc7e4564eb92 7 days ago 169MB

hello-world latest f2a91732366c 12 days ago 1.85kB

ubuntu 16.04 20c44cd7596f 2 weeks ago 123MB

ubuntu latest 20c44cd7596f 2 weeks ago 123MB

busybox latest 6ad733544a63 4 weeks ago 1.13MB

busybox 1.24 47bcc53f74dc 20 months ago 1.11MB

vskumar@ubuntu:~$

===================>

You can see my previous image with ‘docker-exercise/ubuntu-wgetinstall ‘. This was created in the previous exercise.

As per our plan in this session I am using the below commands to run the ubuntu image as below:

sudo docker run -d ubuntu \

    /bin/bash -c "while true; do date; sleep 5; done";

========== Output ======>
vskumar@ubuntu:~$  sudo docker run -d ubuntu \
>     /bin/bash -c "while true; do date; sleep 5; done";
0fe495fc93edee3aaadc7fc0fbf21997f0ca3cde4d7e563aa8c61352a43957dd
vskumar@ubuntu:~$ $ 
=======================>

Now, to view the docker logs I want to run the docker logs subcommand on image id: ‘ 0fe495fc93edee3aaadc7fc0fbf21997f0ca3cde4d7e563aa8c61352a43957dd’

$ sudo docker logs 0fe495fc93edee3aaadc7fc0fbf21997f0ca3cde4d7e563aa8c61352a43957dd;

=====See the output of the Daemon process running with the ubuntu image ===============>

vskumar@ubuntu:~$ sudo docker logs 0fe495fc93edee3aaadc7fc0fbf21997f0ca3cde4d7e563aa8c61352a43957dd;

Sun Dec 3 05:11:57 UTC 2017

Sun Dec 3 05:12:02 UTC 2017

Sun Dec 3 05:12:07 UTC 2017

Sun Dec 3 05:12:12 UTC 2017

Sun Dec 3 05:12:17 UTC 2017

Sun Dec 3 05:12:22 UTC 2017

Sun Dec 3 05:12:27 UTC 2017

Sun Dec 3 05:12:32 UTC 2017

Sun Dec 3 05:12:37 UTC 2017

Sun Dec 3 05:12:42 UTC 2017

Sun Dec 3 05:12:48 UTC 2017

Sun Dec 3 05:12:53 UTC 2017

Sun Dec 3 05:12:58 UTC 2017

Sun Dec 3 05:13:03 UTC 2017

Sun Dec 3 05:13:08 UTC 2017

Sun Dec 3 05:13:13 UTC 2017

Sun Dec 3 05:13:18 UTC 2017

Sun Dec 3 05:13:23 UTC 2017

Sun Dec 3 05:13:28 UTC 2017

Sun Dec 3 05:13:33 UTC 2017

Sun Dec 3 05:13:38 UTC 2017

Sun Dec 3 05:13:43 UTC 2017

Sun Dec 3 05:13:48 UTC 2017

Sun Dec 3 05:13:53 UTC 2017

Sun Dec 3 05:13:58 UTC 2017

Sun Dec 3 05:14:03 UTC 2017

Sun Dec 3 05:14:08 UTC 2017

Sun Dec 3 05:14:13 UTC 2017

Sun Dec 3 05:14:18 UTC 2017

Sun Dec 3 05:14:23 UTC 2017

Sun Dec 3 05:14:28 UTC 2017

Sun Dec 3 05:14:33 UTC 2017

Sun Dec 3 05:14:38 UTC 2017

Sun Dec 3 05:14:43 UTC 2017

Sun Dec 3 05:14:48 UTC 2017

Sun Dec 3 05:14:53 UTC 2017

Sun Dec 3 05:14:58 UTC 2017

Sun Dec 3 05:15:03 UTC 2017

Sun Dec 3 05:15:08 UTC 2017

Sun Dec 3 05:15:13 UTC 2017

Sun Dec 3 05:15:18 UTC 2017

Sun Dec 3 05:15:23 UTC 2017

vskumar@ubuntu:~$

=================You can see the output for every few seconds listed =======>

It means the container is running as a daemon.

Now, let us use ps -eaf command to check the processed running in linux by using :

$ ps -eaf | grep ‘daemon’

========= See the output of daemon processes ==========>

vskumar@ubuntu:~$

vskumar@ubuntu:~$ ps -eaf | grep ‘daemon’

message+ 837 1 0 20:26 ? 00:00:05 /usr/bin/dbus-daemon –system –address=systemd: –nofork –nopidfile –systemd-activation

root 871 1 0 20:26 ? 00:00:03 /usr/sbin/NetworkManager –no-daemon

avahi 873 1 0 20:26 ? 00:00:00 avahi-daemon: running [ubuntu.local]

root 876 1 0 20:26 ? 00:00:01 /usr/lib/accountsservice/accounts-daemon

avahi 893 873 0 20:26 ? 00:00:00 avahi-daemon: chroot helper

rtkit 1370 1 0 20:28 ? 00:00:00 /usr/lib/rtkit/rtkit-daemon

vskumar 2426 1 0 20:55 ? 00:00:00 /usr/bin/gnome-keyring-daemon –daemonize –login

vskumar 2508 2428 0 20:55 ? 00:00:00 upstart-udev-bridge –daemon –user

vskumar 2515 2428 0 20:55 ? 00:00:04 dbus-daemon –fork –session –address=unix:abstract=/tmp/dbus-nPaV5rWlQc

vskumar 2570 2428 0 20:55 ? 00:00:03 /usr/lib/x86_64-linux-gnu/bamf/bamfdaemon

vskumar 2572 2428 0 20:55 ? 00:00:04 /usr/bin/ibus-daemon –daemonize –xim –address unix:tmpdir=/tmp/ibus

vskumar 2575 2428 0 20:55 ? 00:00:00 upstart-file-bridge –daemon –user

vskumar 2579 2428 0 20:55 ? 00:00:00 upstart-dbus-bridge –daemon –system –user –bus-name system

vskumar 2582 2428 0 20:55 ? 00:00:00 upstart-dbus-bridge –daemon –session –user –bus-name session

vskumar 2605 2428 0 20:55 ? 00:00:00 /usr/lib/ibus/ibus-x11 –kill-daemon

vskumar 2630 2428 0 20:56 ? 00:00:00 gpg-agent –homedir /home/vskumar/.gnupg –use-standard-socket –daemon

vskumar 2645 2428 0 20:56 ? 00:00:02 /usr/lib/unity-settings-daemon/unity-settings-daemon

vskumar 2664 2653 0 20:56 ? 00:00:00 /usr/bin/dbus-daemon –config-file=/etc/at-spi2/accessibility.conf –nofork –print-address 3

vskumar 2851 2654 0 20:56 ? 00:00:01 /usr/lib/unity-settings-daemon/unity-fallback-mount-helper

vskumar 2914 2428 0 20:57 ? 00:00:00 /bin/sh -c /usr/lib/x86_64-linux-gnu/zeitgeist/zeitgeist-maybe-vacuum; /usr/bin/zeitgeist-daemon

vskumar 2920 2914 0 20:57 ? 00:00:00 /usr/bin/zeitgeist-daemon

vskumar 3094 2428 0 21:00 ? 00:00:01 /usr/lib/x86_64-linux-gnu/unity-lens-files/unity-files-daemon

root 4148 1253 0 21:11 ? 00:00:00 docker-containerd-shim –namespace moby –workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/0fe495fc93edee3aaadc7fc0fbf21997f0ca3cde4d7e563aa8c61352a43957dd –address /var/run/docker/containerd/docker-containerd.sock –runtime-root /var/run/docker/runtime-runc

vskumar 4480 3206 0 21:19 pts/19 00:00:00 grep –color=auto daemon

vskumar@ubuntu:~$

======== You can see the list of processes running currently ========>

So we are successful! to run a container in a detached mode [not in an interactive mode!] using the command: ‘ sudo docker run -d ubuntu’

You can think in an application architecture having multiple servers or SOA running with different services.

You can simulate the same services using the docker containers, by setting up as images by configuring the required services and connect them to the architecture.

This way the advantages of containers can be utilized well. Where different companies are using and implementing their applications into containers architecture by saving lot of infrastructure cost. No hardware or physical servers are required. Lot of space also can be saved. The microservices architecture leads to the same way.

At this point, I would like to stop this session and in the next blog we will see other exercises.

Vcard-Shanthi Kumar V-v3

 

 

8. DevOps:How to control and operate docker containers

Docker-logo

In  continuation of my previous blog on “7. DevOps: How to track changes in a container”, in this blog I would like to show some lab practice “How to control and operate docker containers”.

Controlling/operating Docker container:

In this exercise initially, we can see on how to start/stop/restart the containers.

The Docker Engine enables us to start, stop, and restart a container with a set of docker subcommands.

Let me display the docker images:

=======================>

vskumar@ubuntu:~$ sudo service docker status

docker.service – Docker Application Container Engine

Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e

Active: active (running) since Sat 2017-11-25 15:09:35 PST; 2min 24s ago

Docs: https://docs.docker.com

Main PID: 1356 (dockerd)

Tasks: 30

Memory: 95.2M

CPU: 3.998s

=========================>

vskumar@ubuntu:~$ sudo docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

hello-world latest f2a91732366c 4 days ago 1.85kB

ubuntu 16.04 20c44cd7596f 8 days ago 123MB

ubuntu latest 20c44cd7596f 8 days ago 123MB

busybox latest 6ad733544a63 3 weeks ago 1.13MB

busybox 1.24 47bcc53f74dc 20 months ago 1.11MB

vskumar@ubuntu:~$

=======================>

Now, I want to launch our container ubuntu 16.04 with start subcommand and experiment with the docker stop subcommand, as given below:

$ sudo docker run -i -t ubuntu:16.04 /bin/bash

======================>
vskumar@ubuntu:~$ 
vskumar@ubuntu:~$ sudo docker run -i -t ubuntu:16.04 /bin/bash
root@d10ad2bd62f7:/# 
======================>
Now, we are with this container in interactive mode.
Let us apply some linux commands as below:
========================>
root@d10ad2bd62f7:/# pwd
/
root@d10ad2bd62f7:/# ls
bin   dev  home  lib64  mnt  proc  run   srv  tmp  var
boot  etc  lib   media  opt  root  sbin  sys  usr
root@d10ad2bd62f7:/# cd home
root@d10ad2bd62f7:/home# ls
root@d10ad2bd62f7:/home# cd ../var
root@d10ad2bd62f7:/var# ls
backups  cache  lib  local  lock  log  mail  opt  run  spool  tmp
root@d10ad2bd62f7:/var# cd tmp
root@d10ad2bd62f7:/var/tmp# pwd
/var/tmp
root@d10ad2bd62f7:/var/tmp# ls
root@d10ad2bd62f7:/var/tmp# cd ../lib
root@d10ad2bd62f7:/var/lib# ls
apt  dpkg  initscripts  insserv  misc  pam  systemd  update-rc.d  urandom
root@d10ad2bd62f7:/var/lib# 
================================>

Now I want to create a file as below in this container:
==================>

root@d10ad2bd62f7:/var/lib# pwd
/var/lib
root@d10ad2bd62f7:/var/lib# cd ../../home
root@d10ad2bd62f7:/home# ls
root@d10ad2bd62f7:/home# touch file1.txt
===================>

Let me add some text into this file as below:
==========>
root@d10ad2bd62f7:/home# echo " Testing containers " > file1.txt
root@d10ad2bd62f7:/home# echo " Applying stop command on containers " > file1.txt
root@d10ad2bd62f7:/home# cat file1.txt
 Applying stop command on containers 
root@d10ad2bd62f7:/home# echo " Testing containers " > file1.txtroot@d10ad2bd62f7:/home# echo " Applying stop command on containers " >> file1.txt
root@d10ad2bd62f7:/home# ls
file1.txt
root@d10ad2bd62f7:/home# ls -l
total 4
-rw-r--r-- 1 root root 59 Nov 25 23:20 file1.txt
root@d10ad2bd62f7:/home# cat file1.txt 
Testing containers 
Applying stop command on containers 
root@d10ad2bd62f7:/home# 
===============>

I have applied some more linux file operations on this container as below:
=================>
root@d10ad2bd62f7:/home#      
root@d10ad2bd62f7:/home# cat file1.txt >> file2.txt
root@d10ad2bd62f7:/home# ls
file1.txt  file2.txt
root@d10ad2bd62f7:/home# ls -l
total 8
-rw-r--r-- 1 root root 59 Nov 25 23:20 file1.txt
-rw-r--r-- 1 root root 59 Nov 25 23:22 file2.txt
root@d10ad2bd62f7:/home# diff file1.txt file2.txt
root@d10ad2bd62f7:/home# echo " Applying restart command also on containers " >> file1.txt
root@d10ad2bd62f7:/home# ls -l
total 8
-rw-r--r-- 1 root root 105 Nov 25 23:23 file1.txt
-rw-r--r-- 1 root root  59 Nov 25 23:22 file2.txt
root@d10ad2bd62f7:/home# diff file1.txt file2.txt3d2
<  Applying restart command also on containers 
root@d10ad2bd62f7:/home# 
====================>
Now, let me apply a stop command on this container and see as 
below by using exit to come out and stop:
=====================>
root@155f4b0764b1:/# 
root@155f4b0764b1:/# exit
exit
vskumar@ubuntu:~$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              f2a91732366c        4 days ago          1.85kB
ubuntu              16.04               20c44cd7596f        8 days ago          123MB
ubuntu              latest              20c44cd7596f        8 days ago          123MB
busybox             latest              6ad733544a63        3 weeks ago         1.13MB
busybox             1.24                47bcc53f74dc        20 months ago       1.11MB
vskumar@ubuntu:~$ sudo docker stop  d10ad2bd62f7
d10ad2bd62f7
vskumar@ubuntu:~$ 
=============>
Now, I want to check the containers status using ps -a command as below:
==============>
vskumar@ubuntu:~$ sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS                     PORTS               NAMES
155f4b0764b1        ubuntu:16.04        "/bin/bash"             2 minutes ago       Exited (0) 2 minutes ago                       zen_volhard
cb1ff260d48e        ubuntu              "ls /usr/src"           10 hours ago        Exited (0) 10 hours ago                        wonderful_hawking
b20691fd8fb5        ubuntu              "ls /usr"               10 hours ago        Exited (0) 10 hours ago                        friendly_mirzakhani
431ba4c53028        ubuntu              "ls"                    10 hours ago        Exited (0) 10 hours ago                        affectionate_nobel
2c31684bb1f4        ubuntu              "ls -la"                10 hours ago        Exited (0) 10 hours ago                        zealous_meitner
fe2e3b449daf        ubuntu              "ls -la /home/."        10 hours ago        Exited (0) 10 hours ago                        dreamy_shirley
c44bdd05b94d        ubuntu              "ls -la home."          10 hours ago        Exited (2) 10 hours ago                        elastic_pasteur
8b8afa82859a        ubuntu              "ls -la"                10 hours ago        Exited (0) 10 hours ago                        festive_panini
2811eb37af61        ubuntu              "ls -la 604831dbce2a"   10 hours ago        Exited (2) 10 hours ago                        jolly_swartz
604831dbce2a        ubuntu:16.04        "/bin/bash"             10 hours ago        Exited (0) 10 hours ago                        vibrant_ride
718636415a7f        ubuntu:16.04        "/bin/bash"             11 hours ago        Exited (0) 10 hours ago                        reverent_noyce
53a7751d4673        ubuntu:16.04        "/bin/bash"             12 hours ago        Exited (0) 12 hours ago                        musing_chandrasekhar
32bc16b508d4        ubuntu              "bash"                  13 hours ago        Exited (0) 13 hours ago                        eager_goldberg
1dd55efde43f        hello-world         "/hello"                13 hours ago        Exited (0) 13 hours ago                        peaceful_pasteur
a744246ffb8e        hello-world         "/hello"                15 hours ago        Exited (0) 15 hours ago                        naughty_wing
1ba71598b7b8        hello-world         "/hello"                15 hours ago        Exited (0) 15 hours ago                        musing_kare
vskumar@ubuntu:~$ 
===================>
you can see the latest status of our container;
155f4b0764b1        ubuntu:16.04        "/bin/bash"             2 minutes ago       Exited (0) 2 minutes ago                       zen_volhard
It means Docker  maintains in the logs on the usage of containers also.
Now, I want to start the previously stopped container using the docker start subcommand 
by specifying the container ID as an argument, as follows:
$ sudo docker start 155f4b0764b1
===============>
vskumar@ubuntu:~$ sudo docker start 155f4b0764b1
155f4b0764b1
vskumar@ubuntu:~$ 
===============>
Let us check the images status also as below:
==================> Copied the 1st two lines only ----->
vskumar@ubuntu:~$ sudo docker ps -a |more
CONTAINER ID        IMAGE               COMMAND                 CREATED         
    STATUS                      PORTS               NAMES
155f4b0764b1        ubuntu:16.04        "/bin/bash"             10 minutes ago  
    Up About a minute                               zen_volhard
11e293722c64        ubuntu:16.04        "/bin/bash"             12 minutes ago  
    Exited (0) 12 minutes ago  
====================>
It means it shows the current status of the container id:155f4b0764b1 
We need to notice one thing here.

By default, the docker start subcommand will not attach to the container.

We can attach it to the container either using the -a option in the docker start subcommand or by explicitly using the docker attach subcommand.

Now let us try these options.

We will see attach command

$ sudo docker attach 155f4b0764b1
=================>
vskumar@ubuntu:~$ 
vskumar@ubuntu:~$ sudo docker attach 155f4b0764b1
root@155f4b0764b1:/# 
root@155f4b0764b1:/#
=================>
So the attach command brought the container into interactive mode.
Now let me exit it and try the -a option with docker start command:
==================>
root@155f4b0764b1:/home# 
root@155f4b0764b1:/home# exit
exit
===============>
with start -a option:
=============>
vskumar@ubuntu:~$ sudo docker start -a 155f4b0764b1
root@155f4b0764b1:/# 
=================>
After exit, I have tried ps command:
=====================>
vskumar@ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
155f4b0764b1        ubuntu:16.04        "/bin/bash"         21 minutes ago      Up 3 minutes                            zen_volhard
vskumar@ubuntu:~$ 
======================>
From the above display you can see that its start and current status.
It means the container is active and running.
Now, I want to make another [below] container active.
1dd55efde43f        hello-world         "/hello"                13 hours ago Exited (0) 13 hours ago                        peaceful_pasteur
Let us see the ps command after these 2 containers are in active state.
I want to use the below command:
$ sudo docker start -a 1dd55efde43f
===================>
vskumar@ubuntu:~$ sudo docker start -a 1dd55efde43f

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

Let us  try something more ambitious, we can run an Ubuntu container with:
 $ docker run -it ubuntu bash

If you want to;
Share images, automate workflows, and more with a free Docker ID:
visit: https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

vskumar@ubuntu:~$ 
===================>
Please note the above container doesn't have a any os related process to 
keep running continuously. 
Just it displays the message only. Hence 
in the list it will not appear. 
Now, let me list the current processes using docker ps command:
===========>
vskumar@ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
155f4b0764b1        ubuntu:16.04        "/bin/bash"         32 minutes ago      Up 14 minutes                           zen_volhard
vskumar@ubuntu:~$ 
==============>
So as on now one container is running.

The next set of container controlling subcommands are docker pause and docker unpause.

The docker pause subcommand will freeze the execution of all the processes within the container.

The docker unpause subcommand will unfreeze the execution of all the processes within the container and resume the execution from the point where it was frozen.

Let us try the below command 
$sudo docker pause 155f4b0764b1
========================>
vskumar@ubuntu:~$ 
vskumar@ubuntu:~$ sudo docker pause 155f4b0764b1
155f4b0764b1
vskumar@ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                   PORTS               NAMES
155f4b0764b1        ubuntu:16.04        "/bin/bash"         About an hour ago   Up 30 minutes (Paused)                       zen_volhard
vskumar@ubuntu:~$ 
==========================>
You can see the current status as Paused.
Now let me try unpause command also.
$ sudo docker unpause 155f4b0764b1
You can see the total output of this container with pause and unpause statuses:
===================>
vskumar@ubuntu:~$ 
vskumar@ubuntu:~$ sudo docker pause 155f4b0764b1
155f4b0764b1
vskumar@ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                   PORTS               NAMES
155f4b0764b1        ubuntu:16.04        "/bin/bash"         About an hour ago   Up 30 minutes (Paused)                       zen_volhard
vskumar@ubuntu:~$ ^C
vskumar@ubuntu:~$ sudo docker unpause 155f4b0764b1
155f4b0764b1
vskumar@ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
155f4b0764b1        ubuntu:16.04        "/bin/bash"         About an hour ago   Up 32 minutes                           zen_volhard
vskumar@ubuntu:~$ 
======================>
Now, in this lab session finally we will use the stop command:

The container and the script running within it can be stopped using the docker stop subcommand, as shown below:

$ sudo docker stop 155f4b0764b1
=====================> 
vskumar@ubuntu:~$ sudo docker stop 155f4b0764b1
155f4b0764b1
vskumar@ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED STATUS              PORTS               NAMES
=============== It shows there is no active container =============>
Now, let me try with -a and more options.
=========== Partial display is shown here upto the container ===========>
vskumar@ubuntu:~$ sudo docker ps -a |more
CONTAINER ID        IMAGE               COMMAND                 CREATED         
    STATUS                         PORTS               NAMES
f123dbd09116        ubuntu:16.04        "/bin/bash"             6 minutes ago   
    Exited (0) 5 minutes ago                           elastic_nightingale
3cfdea29ce6e        ubuntu              "bash"                  14 minutes ago  
    Exited (0) 14 minutes ago                          gallant_nobel
155f4b0764b1        ubuntu:16.04        "/bin/bash"             About an hour ag
o   Exited (0) 17 seconds ago  
================================>

So far in this lab session, we have seen the differences of different commands to operate and control the containers. I would like to break this session for now. In the next blog we will see on how to manage “Housekeeping containers“.

 Vcard-Shanthi Kumar V

 

7. DevOps: How to track changes in a container

Docker-logo

In  continuation of my previous blog on “6. DevOps: How to work with interactive docker containers”, in this blog I would like to show some lab practice “How to track changes in a container”.

Tracking changes inside containers:

Now, let us see the container operations and tracking them.

Let’s launch a container in interactive mode, as we have done in previous session, we can use the below command.

$ sudo docker run -i -t ubuntu:16.04 /bin/bash 
=================>
vskumar@ubuntu:/var/log$ sudo docker run -i -t ubuntu:16.04 /bin/bash  
root@718636415a7f:/# ps
   PID TTY          TIME CMD
     1 pts/0    00:00:00 bash
     9 pts/0    00:00:00 ps
root@718636415a7f:/# ps -ef
UID         PID   PPID  C STIME TTY          TIME CMD
root          1      0  0 12:39 pts/0    00:00:00 /bin/bash
root         10      1  0 12:53 pts/0    00:00:00 ps -ef
root@718636415a7f:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@718636415a7f:/# 
======================>
Now, let us go to home directory:
========>
root@718636415a7f:/# pwd
/
root@718636415a7f:/# cd home
root@718636415a7f:/home# pwd
/home
root@718636415a7f:/home# ls
root@718636415a7f:/home# 
==============>
Now, as a standalone machine of this docker container, 
I want to create 4 text files using touch command as below:
==============>
root@718636415a7f:/home# ls
root@718636415a7f:/home# ls -l
total 0
root@718636415a7f:/home# touch {vsk1,vsk2,vsk3,vsk4}
root@718636415a7f:/home# ls -l
total 0
-rw-r--r-- 1 root root 0 Nov 25 12:57 vsk1
-rw-r--r-- 1 root root 0 Nov 25 12:57 vsk2
-rw-r--r-- 1 root root 0 Nov 25 12:57 vsk3
-rw-r--r-- 1 root root 0 Nov 25 12:57 vsk4
root@718636415a7f:/home# 
======================>

I am adding some text to each of them as below:

====================>

root@718636415a7f:/home# pwd

/home

root@718636415a7f:/home# echo ‘Testing vsk1’ > vsk1

root@718636415a7f:/home# ls -l

total 4

-rw-r–r– 1 root root 13 Nov 25 13:02 vsk1

-rw-r–r– 1 root root 0 Nov 25 12:57 vsk2

-rw-r–r– 1 root root 0 Nov 25 12:57 vsk3

-rw-r–r– 1 root root 0 Nov 25 12:57 vsk4

root@718636415a7f:/home# echo ‘Testing vsk2’ > vsk2

root@718636415a7f:/home# echo ‘Testing vsk3’ > vsk3

root@718636415a7f:/home# echo ‘NOT Testing vsk4’ > vsk4

root@718636415a7f:/home# ls -l

total 16

-rw-r–r– 1 root root 13 Nov 25 13:02 vsk1

-rw-r–r– 1 root root 13 Nov 25 13:02 vsk2

-rw-r–r– 1 root root 13 Nov 25 13:02 vsk3

-rw-r–r– 1 root root 17 Nov 25 13:02 vsk4

root@718636415a7f:/home#

=====================>

I have created 4 files and added some text into them.

Now, I want to execute a diff command on them:

==========================>

root@718636415a7f:/home# diff vsk1 vsk2

1c1

< Testing vsk1

> Testing vsk2

root@718636415a7f:/home# diff vsk2 vsk3

1c1

< Testing vsk2

> Testing vsk3

root@718636415a7f:/home# echo ‘NOT Testing vsk4’ > vsk1

root@718636415a7f:/home# diff vsk1 vsk4

root@718636415a7f:/home# diff vsk2 vsk4

1c1

< Testing vsk2

> NOT Testing vsk4

root@718636415a7f:/home#

===========================>

Now, I want to exit this container and go back to docker host.

I have detached it using exit.

And back to docker host.

Now, I want to use the diff command as below from host machine to the container:

===========================>

root@718636415a7f:/home# ls -l

total 16

-rw-r–r– 1 root root 17 Nov 25 13:05 vsk1

-rw-r–r– 1 root root 13 Nov 25 13:02 vsk2

-rw-r–r– 1 root root 13 Nov 25 13:02 vsk3

-rw-r–r– 1 root root 17 Nov 25 13:02 vsk4

root@718636415a7f:/home# exit

exit

vskumar@ubuntu:/var/log$ sudo docker diff 718636415a7f

[sudo] password for vskumar:

C /home

A /home/vsk1

A /home/vsk2

A /home/vsk3

A /home/vsk4

C /root

A /root/.bash_history

vskumar@ubuntu:/var/log$

=====================>

The 1st line ‘C /home’ shows; the home directory is modified by showing ‘C’ as changed.

The ‘A’ shows;  before each line denotes the file is added.

If you have a deleted file, it can show as ‘D’ before the file.

Also please let us note here on how docker engine picks up the image with the below priority;

When we work with an image and if we don’t specify that image name, then the latest image (recently generated) will be identified and used by the Docker Engine.

We can check the status of the containers as below using ps -a:

You can see a detailed output from this command from the below display:

==================================>

vskumar@ubuntu:/var/log$ ls

alternatives.log bootstrap.log dmesg fsck kern.log speech-dispatcher unattended-upgrades wtmp

apport.log btmp dpkg.log gpu-manager.log lastlog syslog upstart Xorg.0.log

apt cups faillog hp lightdm syslog.1 vmware Xorg.0.log.old

auth.log dist-upgrade fontconfig.log installer samba syslog.2.gz vmware-vmsvc.log

vskumar@ubuntu:/var/log$ sudo docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

cb1ff260d48e ubuntu “ls /usr/src” 3 minutes ago Exited (0) 3 minutes ago wonderful_hawking

b20691fd8fb5 ubuntu “ls /usr” 3 minutes ago Exited (0) 3 minutes ago friendly_mirzakhani

431ba4c53028 ubuntu “ls” 3 minutes ago Exited (0) 3 minutes ago affectionate_nobel

2c31684bb1f4 ubuntu “ls -la” 3 minutes ago Exited (0) 3 minutes ago zealous_meitner

fe2e3b449daf ubuntu “ls -la /home/.” 4 minutes ago Exited (0) 4 minutes ago dreamy_shirley

c44bdd05b94d ubuntu “ls -la home.” 4 minutes ago Exited (2) 4 minutes ago elastic_pasteur

8b8afa82859a ubuntu “ls -la” 4 minutes ago Exited (0) 4 minutes ago festive_panini

2811eb37af61 ubuntu “ls -la 604831dbce2a” 4 minutes ago Exited (2) 4 minutes ago jolly_swartz

604831dbce2a ubuntu:16.04 “/bin/bash” 8 minutes ago Exited (0) 6 minutes ago vibrant_ride

718636415a7f ubuntu:16.04 “/bin/bash” 45 minutes ago Exited (0) 18 minutes ago reverent_noyce

53a7751d4673 ubuntu:16.04 “/bin/bash” 2 hours ago Exited (0) 2 hours ago musing_chandrasekhar

32bc16b508d4 ubuntu “bash” 3 hours ago Exited (0) 3 hours ago eager_goldberg

1dd55efde43f hello-world “/hello” 3 hours ago Exited (0) 3 hours ago peaceful_pasteur

a744246ffb8e hello-world “/hello” 5 hours ago Exited (0) 5 hours ago naughty_wing

1ba71598b7b8 hello-world “/hello” 5 hours ago Exited (0) 5 hours ago musing_kare

vskumar@ubuntu:/var/log$

============================>

I would like to terminate the session at this point. In the next blog I would like to present “How to control and operate docker containers”.

Vcard-Shanthi Kumar V-v3

6. DevOps: How to work with interactive Docker containers

Docker-logo

In  continuation of my previous blog on “5. DevOps: How to work with Docker Images”, in this blog I would like to show some lab practice on Interactive Docker containers.

Working with an interactive Docker container:

In the previous lab session, we worked with first Hello World container. And we came to know how the containerization works. Now, we are going to run a container in interactive mode.

What is docker run command ?:

The docker run subcommand takes an image as an input and launches it as a container.

What flags we need to use ?:

We have to pass the -t and -i flags to the docker run subcommand in order to make the container interactive.

The -i flag is the key driver, it makes the container interactive by grabbing the standard input (STDIN) of the container into the terminal.

The -t flag allocates a pseudo-TTY or a pseudo Terminal (Terminal emulator) and then assigns that to the container.

Note: Please note in the earlier session we have executed a container on unbuntu name.

But now, we will explore completely the interactive container operations.

In the below example, we are going to launch an interactive container using the ubuntu:16.04 image and /bin/bash as the command:

$ sudo docker run -i -t ubuntu:16.04 /bin/bash 

=========== Output ============>

vskumar@ubuntu:/var/log$ sudo docker run -i -t ubuntu:16.04 /bin/bash

Unable to find image ‘ubuntu:16.04’ locally

16.04: Pulling from library/ubuntu

Digest: sha256:7c67a2206d3c04703e5c23518707bdd4916c057562dd51c74b99b2ba26af0f79

Status: Downloaded newer image for ubuntu:16.04

root@53a7751d4673:/#

===================>

Why the error messages [Unable to find image] appear ?:

As the ubuntu 16.04 image is not downloaded yet, we get the above message and with the docker run command it will start pulling the ubuntu 16.04 image automatically with following message:

Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu

When the download is completed, the container will get launched along with the ubuntu:16.04 image.

It will also launch a Bash shell within the container, because we have specified /bin/bash as the command to be executed. This landed us in a Bash prompt, as shown below:

root@53a7751d4673:/#

What is ’53a7751d4673′?:

It is the hostname of the container. In Docker, the hostname is the same as the container ID.

Now, let us run a few commands interactively and confirm what we mentioned about the prompt is correct, as shown below:

To check the hostname below commands need to be executed:

root@53a7751d4673:/# hostname

root@53a7751d4673:/# id

root@53a7751d4673:/# echo $PS1

When we execute them, can see the below output:

==============>

root@53a7751d4673:/#

root@53a7751d4673:/# hostname

53a7751d4673

root@53a7751d4673:/# id

uid=0(root) gid=0(root) groups=0(root)

root@53a7751d4673:/# echo $PS1

\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$

root@53a7751d4673:/#

=====================>

So, we have seen the Host name as ’53a7751d4673′.

Id as ‘root ‘

Using ‘PS1’, —>Displays username, hostname and current working directory in the prompt.

PS1 in this example displays the following three information in the prompt:

\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$

  • \u – Username
  • \h – Hostname
  • \w – Full path of the current working directory

==============>

root@53a7751d4673:/# pwd

/

root@53a7751d4673:/#

==========>

Note, we are within the ubuntu 16.04 container and it works as Linux machine. So we can try some Linux commands also:

===============>

root@53a7751d4673:/# ps

PID TTY TIME CMD

1 pts/0 00:00:00 bash

26 pts/0 00:00:00 ps

root@53a7751d4673:/# ps -ef

UID PID PPID C STIME TTY TIME CMD

root 1 0 0 11:28 pts/0 00:00:00 /bin/bash

root 27 1 0 11:48 pts/0 00:00:00 ps -ef

root@53a7751d4673:/#

root@53a7751d4673:/# ls

bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var

root@53a7751d4673:/# ls -l

total 64

drwxr-xr-x 2 root root 4096 Nov 14 13:49 bin

drwxr-xr-x 2 root root 4096 Apr 12 2016 boot

drwxr-xr-x 5 root root 360 Nov 25 11:28 dev

drwxr-xr-x 45 root root 4096 Nov 25 11:28 etc

drwxr-xr-x 2 root root 4096 Apr 12 2016 home

drwxr-xr-x 8 root root 4096 Sep 13 2015 lib

drwxr-xr-x 2 root root 4096 Nov 14 13:49 lib64

drwxr-xr-x 2 root root 4096 Nov 14 13:48 media

drwxr-xr-x 2 root root 4096 Nov 14 13:48 mnt

drwxr-xr-x 2 root root 4096 Nov 14 13:48 opt

dr-xr-xr-x 250 root root 0 Nov 25 11:28 proc

drwx—— 2 root root 4096 Nov 14 13:49 root

drwxr-xr-x 6 root root 4096 Nov 14 13:49 run

drwxr-xr-x 2 root root 4096 Nov 17 21:59 sbin

drwxr-xr-x 2 root root 4096 Nov 14 13:48 srv

dr-xr-xr-x 13 root root 0 Nov 25 11:28 sys

drwxrwxrwt 2 root root 4096 Nov 14 13:49 tmp

drwxr-xr-x 11 root root 4096 Nov 14 13:48 usr

drwxr-xr-x 13 root root 4096 Nov 14 13:49 var

root@53a7751d4673:/#

================>

So, ubuntu 16.04 container is nothing but a linux machine and we executed the above commands.

Now, I want to change the root permissions as below:

==============>

root@53a7751d4673:/# chmod +777 root

root@53a7751d4673:/# ls -l

total 64

drwxr-xr-x 2 root root 4096 Nov 14 13:49 bin

drwxr-xr-x 2 root root 4096 Apr 12 2016 boot

drwxr-xr-x 5 root root 360 Nov 25 11:28 dev

drwxr-xr-x 45 root root 4096 Nov 25 11:28 etc

drwxr-xr-x 2 root root 4096 Apr 12 2016 home

drwxr-xr-x 8 root root 4096 Sep 13 2015 lib

drwxr-xr-x 2 root root 4096 Nov 14 13:49 lib64

drwxr-xr-x 2 root root 4096 Nov 14 13:48 media

drwxr-xr-x 2 root root 4096 Nov 14 13:48 mnt

drwxr-xr-x 2 root root 4096 Nov 14 13:48 opt

dr-xr-xr-x 255 root root 0 Nov 25 11:28 proc

drwxrwxrwx 2 root root 4096 Nov 14 13:49 root

drwxr-xr-x 6 root root 4096 Nov 14 13:49 run

drwxr-xr-x 2 root root 4096 Nov 17 21:59 sbin

drwxr-xr-x 2 root root 4096 Nov 14 13:48 srv

dr-xr-xr-x 13 root root 0 Nov 25 11:48 sys

drwxrwxrwt 2 root root 4096 Nov 14 13:49 tmp

drwxr-xr-x 11 root root 4096 Nov 14 13:48 usr

drwxr-xr-x 13 root root 4096 Nov 14 13:49 var

root@53a7751d4673:/#

================>

Now, I want to exit from container and come back to host machine.

==================>

root@53a7751d4673:/#

root@53a7751d4673:/# exit

exit

vskumar@ubuntu:/var/log$

===============>

Whenever the Bash exit command is used in the interactive container, it will terminate the Bash shell process.

In turn it will stop the container and returns to the docker host machine.

As a result, we can see the Docker host’s prompt $


You can see the status of docker images as below when I used ‘sudo docker images’ :

==================>

vskumar@ubuntu:/var/log$

vskumar@ubuntu:/var/log$ sudo docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

hello-world latest f2a91732366c 4 days ago 1.85kB

ubuntu 16.04 20c44cd7596f 7 days ago 123MB

ubuntu latest 20c44cd7596f 7 days ago 123MB

busybox latest 6ad733544a63 3 weeks ago 1.13MB

busybox 1.24 47bcc53f74dc 20 months ago 1.11MB

vskumar@ubuntu:/var/log$

=====================>

You can see whatever containers; we have have used in the past exercises.

At this point, I would like to stop this lab session. And in the next blog we can see on “How to track changes in a container?”.

 

Vcard-Shanthi Kumar V

 

 

5. DevOps: How to work with Docker Images

Docker-logo

In  continuation of my previous blog on “4. DevOps: How to work with Docker Containers”, in this blog I would like to give some lab practice on Docker Images.

How to pull the docker public images ?:
Docker portal will have numerous images available  under public.
Now, there is a need for us to know the usage of docker pull command, which is the defacto command to download Docker images.

Now, in this section, we will use the busybox image, one of the smallest but a very handy Docker image, to dive deep into Docker image handling:
$sudo docker pull busybox
============= Output ============>
vskumar@ubuntu:/var/tmp$ sudo docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
0ffadd58f2a6: Pull complete
Digest: sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0
Status: Downloaded newer image for busybox:latest
vskumar@ubuntu:/var/tmp$
=================>
Sometimes it might reject this request. We need to keep on trying to get it. I tried 4 times at different timings to connect to it.
Please note now, we have three images as below through all of our so far exercises:
===================>
vskumar@ubuntu:/var/log$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest f2a91732366c 4 days ago 1.85kB
ubuntu latest 20c44cd7596f 7 days ago 123MB
busybox latest 6ad733544a63 3 weeks ago 1.13MB
vskumar@ubuntu:/var/log$
===============>
Now, let us stop the docker services and check the status as below:
=================>
vskumar@ubuntu:/var/log$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest f2a91732366c 4 days ago 1.85kB
ubuntu latest 20c44cd7596f 7 days ago 123MB
busybox latest 6ad733544a63 3 weeks ago 1.13MB
vskumar@ubuntu:/var/log$ sudo service docker stop
vskumar@ubuntu:/var/log$ sudo service docker status
● docker.service – Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
Active: inactive (dead) since Sat 2017-11-25 02:52:25 PST; 8s ago
Docs: https://docs.docker.com
Process: 1224 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=0/SUCCE
Main PID: 1224 (code=exited, status=0/SUCCESS)
Nov 25 02:21:42 ubuntu dockerd[1224]: time=”2017-11-25T02:21:42.863518710-08:00″
Nov 25 02:21:43 ubuntu dockerd[1224]: time=”2017-11-25T02:21:43-08:00″ level=inf
Nov 25 02:27:08 ubuntu dockerd[1224]: time=”2017-11-25T02:27:08.010096274-08:00″
Nov 25 02:27:08 ubuntu dockerd[1224]: time=”2017-11-25T02:27:08-08:00″ level=inf
Nov 25 02:27:08 ubuntu dockerd[1224]: time=”2017-11-25T02:27:08.199685599-08:00″
Nov 25 02:52:25 ubuntu dockerd[1224]: time=”2017-11-25T02:52:25.010875880-08:00″
Nov 25 02:52:25 ubuntu systemd[1]: Stopping Docker Application Container Engine.
Nov 25 02:52:25 ubuntu dockerd[1224]: time=”2017-11-25T02:52:25.081714537-08:00″
Nov 25 02:52:25 ubuntu systemd[1]: Stopped Docker Application Container Engine.
Nov 25 02:52:25 ubuntu systemd[1]: Stopped Docker Application Container Engine.
vskumar@ubuntu:/var/log$
====================>
You can see the inactive status of docker.
In such cases, restart the Docker service, as shown here:

$ sudo service docker restart
You can see the output as below:
==================>
vskumar@ubuntu:/var/log$ sudo service docker restart
vskumar@ubuntu:/var/log$ sudo service docker status 
docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
   Active: active (running) since Sat 2017-11-25 02:54:42 PST; 6s ago
     Docs: https://docs.docker.com
 Main PID: 3769 (dockerd)
    Tasks: 18
   Memory: 24.6M
      CPU: 989ms
   CGroup: /system.slice/docker.service
           ├─3769 /usr/bin/dockerd -H fd://
           └─3778 docker-containerd --config /var/run/docker/containerd/containe

Nov 25 02:54:41 ubuntu dockerd[3769]: time="2017-11-25T02:54:41.159062708-08:00"
Nov 25 02:54:41 ubuntu dockerd[3769]: time="2017-11-25T02:54:41.159806997-08:00"
Nov 25 02:54:41 ubuntu dockerd[3769]: time="2017-11-25T02:54:41.163503112-08:00"
Nov 25 02:54:41 ubuntu dockerd[3769]: time="2017-11-25T02:54:41.743276580-08:00"
Nov 25 02:54:41 ubuntu dockerd[3769]: time="2017-11-25T02:54:41.955217284-08:00"
Nov 25 02:54:41 ubuntu dockerd[3769]: time="2017-11-25T02:54:41.975961283-08:00"
Nov 25 02:54:42 ubuntu dockerd[3769]: time="2017-11-25T02:54:42.092220161-08:00"
Nov 25 02:54:42 ubuntu dockerd[3769]: time="2017-11-25T02:54:42.094334663-08:00"
Nov 25 02:54:42 ubuntu systemd[1]: Started Docker Application Container Engine.
Nov 25 02:54:42 ubuntu dockerd[3769]: time="2017-11-25T02:54:42.190194886-08:00"

vskumar@ubuntu:/var/log$ 

========================>

Now, let us reconfirm the existing docker images as below:
================>

vskumar@ubuntu:/var/log$ ^C
vskumar@ubuntu:/var/log$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              f2a91732366c        4 days ago          1.85kB
ubuntu              latest              20c44cd7596f        7 days ago          123MB
busybox             latest              6ad733544a63        3 weeks ago         1.13MB
vskumar@ubuntu:/var/log$ 
=======================>

By default, Docker always uses the image that is tagged as latest.

Each image variant can be directly identified by qualifying it with an appropriate tag.

An image can be tag-qualified by adding a colon (:) between the tag and the repository name (<repository>:<tag>). For demonstration, we will pull the 1.24 tagged version of busybox as shown here:

Now, For lab demonstration, we will pull the 1.24 tagged version of busybox as shown here:

$ sudo docker pull busybox:1.24

Now. You can see the total output before and after executing the above command:

==============================>

vskumar@ubuntu:/var/log$ ^C

vskumar@ubuntu:/var/log$ sudo docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

hello-world latest f2a91732366c 4 days ago 1.85kB

ubuntu latest 20c44cd7596f 7 days ago 123MB

busybox latest 6ad733544a63 3 weeks ago 1.13MB

vskumar@ubuntu:/var/log$ ^C

vskumar@ubuntu:/var/log$

vskumar@ubuntu:/var/log$

vskumar@ubuntu:/var/log$ sudo docker pull busybox:1.24

1.24: Pulling from library/busybox

385e281300cc: Pull complete

a3ed95caeb02: Pull complete

Digest: sha256:8ea3273d79b47a8b6d018be398c17590a4b5ec604515f416c5b797db9dde3ad8

Status: Downloaded newer image for busybox:1.24

vskumar@ubuntu:/var/log$ sudo docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

hello-world latest f2a91732366c 4 days ago 1.85kB

ubuntu latest 20c44cd7596f 7 days ago 123MB

busybox latest 6ad733544a63 3 weeks ago 1.13MB

busybox 1.24 47bcc53f74dc 20 months ago 1.11MB

vskumar@ubuntu:/var/log$

==============================>

There are two busybox containers with different versions.

So, on the basis of TAG values the containers are being pulled.

How to Search Docker images:

So far we have pulled the known images from the docker-hub.

Let us identify some docker images by using a search option as below. We can search for Docker images in the Docker Hub Registry using the docker search subcommand, as shown in this example:

$ sudo docker search mysql

You can see the displayed output of mysql images from the Docker Hub Registry:

=============>

vskumar@ubuntu:/var/log$ sudo docker search mysql

NAME DESCRIPTION STARS OFFICIAL AUTOMATED

mysql MySQL is a widely used, open-source relation… 5278 [OK]

mariadb MariaDB is a community-developed fork of MyS… 1634 [OK]

mysql/mysql-server Optimized MySQL Server Docker images. Create… 368 [OK]

percona Percona Server is a fork of the MySQL relati… 303 [OK]

hypriot/rpi-mysql RPi-compatible Docker Image with Mysql 74

zabbix/zabbix-server-mysql Zabbix Server with MySQL database support 64 [OK]

centurylink/mysql Image containing mysql. Optimized to be link… 53 [OK]

sameersbn/mysql 48 [OK]

zabbix/zabbix-web-nginx-mysql Zabbix frontend based on Nginx web-server wi… 38 [OK]

tutum/mysql Base docker image to run a MySQL database se… 29

1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5 ubuntu-16-nginx-php-phpmyadmin-mysql-5 17 [OK]

schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic backup… 16 [OK]

centos/mysql-57-centos7 MySQL 5.7 SQL database server 15

linuxserver/mysql A Mysql container, brought to you by LinuxSe… 12

centos/mysql-56-centos7 MySQL 5.6 SQL database server 6

openshift/mysql-55-centos7 DEPRECATED: A Centos7 based MySQL v5.5 image… 6

frodenas/mysql A Docker Image for MySQL 3 [OK]

dsteinkopf/backup-all-mysql backup all DBs in a mysql server 3 [OK]

circleci/mysql MySQL is a widely used, open-source relation… 2

cloudfoundry/cf-mysql-ci Image used in CI of cf-mysql-release 0

cloudposse/mysql Improved `mysql` service with support for `m… 0 [OK]

ansibleplaybookbundle/rhscl-mysql-apb An APB which deploys RHSCL MySQL 0 [OK]

astronomerio/mysql-sink MySQL sink 0 [OK]

inferlink/landmark-mysql landmark-mysql 0 [OK]

astronomerio/mysql-source MySQL source 0 [OK]

vskumar@ubuntu:/var/log$ ^C

vskumar@ubuntu:/var/log$

====================>

You can get the top 5 images by suing head -5 linux command.

$sudo docker search mysql | head -5

=============>

vskumar@ubuntu:/var/log$ sudo docker search mysql | head -5

NAME DESCRIPTION STARS OFFICIAL AUTOMATED

mysql MySQL is a widely used, open-source relation… 5278 [OK]

mariadb MariaDB is a community-developed fork of MyS… 1634 [OK]

mysql/mysql-server Optimized MySQL Server Docker images. Create… 368 [OK]

percona Percona Server is a fork of the MySQL relati… 303 [OK]

vskumar@ubuntu:/var/log$

===============>

If you see the above list, The mysql image curated and hosted by Docker Inc has a 5278 star rating, which is indicated as this is the most popular mysql image and aslo as Official image to use it. For security reasons we should use the official and highly rated images only.

As we planned, in this blog we have worked with the Docker images.

At this point we can stop this session and in the next blog we can see on “How to work with interactive containers”.

Vcard-Shanthi Kumar V-v3

Feel free to Contact me :

 

My Kindle and Kobo books

Dear Regular reader!

Welcome!

Following  are my Kindle books.  

Click on the book image to go to its  page.

Cover-BI6

You can watch the video on:

https://www.youtube.com/watch?v=R-krH66K3xs

 

 

Cover-page-Test plan-create space

Cover-Control Cost-startup

Watch video on:

https://www.youtube.com/watch?v=

Book-Image-19th Jan 16

 

E-Book cover-SS-Startup

 

For other books visit:

http://www.amazon.com/s/ref=nb_sb_noss_2/187-7995104-7518315?url=search-alias%3Dstripbooks&field-keywords=Shanthi+Vemulapalli

You can also visit Kobo store for these books.