{"id":448,"date":"2020-11-22T22:29:58","date_gmt":"2020-11-22T21:29:58","guid":{"rendered":"http:\/\/hentati.org\/?p=448"},"modified":"2020-11-25T23:01:14","modified_gmt":"2020-11-25T22:01:14","slug":"448","status":"publish","type":"post","link":"https:\/\/hentati.org\/index.php\/2020\/11\/22\/448\/","title":{"rendered":"Docker &#8211; First Step"},"content":{"rendered":"<p><span style=\"color: #000000;\">First of all, we have to verify the version of our Operating System :<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Prerequisite :<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">OS should be 64 bit<\/span><\/p>\n<p><span style=\"color: #000000;\">Linux kernel ver 3.10 or greater<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Command to check : <\/strong><\/span><\/p>\n<pre><span style=\"color: #000000;\">uname -r<\/span><\/pre>\n<h4><span style=\"color: #000000;\">\u00a0<\/span><\/h4>\n<h4><span style=\"color: #000000;\">STEP 1 &#8211; Install &amp; Start DOCKER<\/span><\/h4>\n<pre><span style=\"color: #000000;\">sudo yum -y update\r\n\r\nsudo yum install -y docker<\/span><\/pre>\n<pre><span style=\"color: #000000;\">docker --version<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong><img loading=\"lazy\" class=\"alignnone wp-image-449\" src=\"http:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-1-300x57.png\" alt=\"\" width=\"753\" height=\"143\" srcset=\"https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-1-300x57.png 300w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-1.png 674w\" sizes=\"(max-width: 753px) 100vw, 753px\" \/><\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Start DOCKER\u00a0: <\/strong><\/span><\/p>\n<pre><span style=\"color: #000000;\">sudo service docker start<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>Stop DOCKER\u00a0: <\/strong><\/span><\/p>\n<pre><span style=\"color: #000000;\">sudo service docker stop<\/span><\/pre>\n<p><span style=\"color: #000000;\">We have also to add our current user, to have permission to use Docker<\/span><\/p>\n<pre><span style=\"color: #000000;\">sudo usermod -a -G docker \"user\"<\/span><\/pre>\n<p><span style=\"color: #000000;\"><img loading=\"lazy\" class=\"alignnone wp-image-450\" src=\"http:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-2-300x88.png\" alt=\"\" width=\"824\" height=\"242\" srcset=\"https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-2-300x88.png 300w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-2-768x225.png 768w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-2-1024x300.png 1024w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-2.png 1917w\" sizes=\"(max-width: 824px) 100vw, 824px\" \/><\/span><\/p>\n<p><span style=\"color: #000000;\">To run hello-world image :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker run hello-world\u00a0<\/span><\/pre>\n<p><span style=\"color: #000000;\">To get list of images present locally :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker images\u00a0<\/span><\/pre>\n<p><span style=\"color: #000000;\"><img loading=\"lazy\" class=\"alignnone wp-image-451\" src=\"http:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-3-300x50.png\" alt=\"\" width=\"848\" height=\"141\" srcset=\"https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-3-300x50.png 300w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-3-768x129.png 768w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-3-1024x172.png 1024w\" sizes=\"(max-width: 848px) 100vw, 848px\" \/><\/span><\/p>\n<p><span style=\"color: #000000;\">To get list of running containers :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker ps<\/span><\/pre>\n<p><span style=\"color: #000000;\">To get list of all containers :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker ps -a\u00a0<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #000000;\">STEP 2 \u2013 Docker Basic Commands &#8211; Step by Step for Beginners<\/span><\/h4>\n<p><span style=\"color: #000000;\">To have more informations about Docker version :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker --version\r\n\r\ndocker -v\r\n\r\ndocker --info\r\n\r\ndocker --help\r\n<\/span><\/pre>\n<p><span style=\"color: #000000;\">To download images on local repository of Docker (example : centos)<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker pull centos<\/span><\/pre>\n<p><span style=\"color: #000000;\">To delete images on local repository of Docker\u00a0(example : centos)\u00a0<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker rmi centos<\/span><\/pre>\n<p><span style=\"color: #000000;\"><img loading=\"lazy\" class=\"alignnone wp-image-452\" src=\"http:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-4-300x190.png\" alt=\"\" width=\"808\" height=\"512\" srcset=\"https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-4-300x190.png 300w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-4-1024x647.png 1024w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-4.png 1174w\" sizes=\"(max-width: 808px) 100vw, 808px\" \/><\/span><\/p>\n<p><span style=\"color: #000000;\">To manage Containers :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker ps\r\n\r\ndocker run\r\n\r\ndocker start\r\n\r\ndocker stop<\/span><\/pre>\n<p><span style=\"color: #000000;\">To run ubuntu container and connect on it :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker run -it ubuntu<\/span><\/pre>\n<p><span style=\"color: #000000;\"><img loading=\"lazy\" class=\"alignnone wp-image-453\" src=\"http:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-5-300x60.png\" alt=\"\" width=\"810\" height=\"162\" srcset=\"https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-5-300x60.png 300w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-5-768x153.png 768w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-5-1024x204.png 1024w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-5.png 1318w\" sizes=\"(max-width: 810px) 100vw, 810px\" \/><\/span><\/p>\n<p><span style=\"color: #000000;\">To see statistics :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker stats\r\n\r\ndocker system df<\/span><\/pre>\n<p><span style=\"color: #000000;\">To delete all Docker platform :<\/span><\/p>\n<pre><span style=\"color: #000000;\">docker system prune\u00a0<\/span><\/pre>\n<p><span style=\"color: #000000;\"><img loading=\"lazy\" class=\"alignnone wp-image-454\" src=\"http:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-6-300x70.png\" alt=\"\" width=\"827\" height=\"193\" srcset=\"https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-6-300x70.png 300w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-6-768x179.png 768w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-6-1024x239.png 1024w, https:\/\/hentati.org\/wp-content\/uploads\/2020\/11\/A3image-6.png 1068w\" sizes=\"(max-width: 827px) 100vw, 827px\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First of all, we have to verify the version of our Operating System : Prerequisite : OS should be 64 bit Linux kernel ver 3.10 or greater Command to check &#8230;<\/p>\n","protected":false},"author":1,"featured_media":472,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/448"}],"collection":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":15,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"predecessor-version":[{"id":470,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/448\/revisions\/470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/media\/472"}],"wp:attachment":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}