{"id":150,"date":"2023-01-04T08:23:05","date_gmt":"2023-01-04T08:23:05","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=150"},"modified":"2024-12-23T11:44:33","modified_gmt":"2024-12-23T11:44:33","slug":"start-your-journey-with-docker","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/","title":{"rendered":"Start your journey with Docker&#8230;.!!!"},"content":{"rendered":"\n<p><strong>Let&#8217;s talk about Docker. As you have read in <a style=\"text-decoration: underline;\" href=\"http:\/\/cloudkul.com\/blog\/docker-a-new-era-of-virtualization\/\" target=\"_blank\" rel=\"noopener\">earlier blogs.<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What exactly docker is?<\/strong><\/h2>\n\n\n\n<p>Now let&#8217;s talk about the next question, What makes <a href=\"https:\/\/cloudkul.com\/blog\/docker-a-new-era-of-virtualization\/\">Docker so attractive<\/a> &amp; how does it work ??<\/p>\n\n\n\n<p>Around 10 Years ago, when the virtual machines started, we realized that virtual machines shared the same hardware with the base machine.<\/p>\n\n\n\n<p>The goal of virtual machines was to ensure that if one failed, then it wouldn&#8217;t impact the host. Additionally, they provided isolated environments for various applications.<\/p>\n\n\n\n<p>In short, a virtual machine is a resource through which we can create an elusion for the app that has its own environment. <\/p>\n\n\n\n<p>But even at that time base machine had an enormous load of various virtualized machines, to overcome this situation a new application was launched named &#8216;docker&#8217;.<\/p>\n\n\n\n<p>It is a very lightweight application and shares the kernel with the base machine in other words it virtualized the environment rather than virtualizing a machine.<\/p>\n\n\n\n<p>The main thing I would like to share with you is we have to install the<a href=\"https:\/\/cloudkul.com\/docker\/\"> Docker application<\/a> and then we can run 10-15 containers or more than that on the single base machine without any problem.<\/p>\n\n\n\n<p>Like in our Laptop, we can&#8217;t install 10-15 virtual machines as various applications need their own environment. <\/p>\n\n\n\n<p>So, on your laptop, if there is docker installed, then you can work very easily anywhere around the world. However, It does not have any dependency issues.<\/p>\n\n\n\n<p><a href=\"https:\/\/cloudkul.com\/blog\/docker-containers-linking\/\">Docker containers<\/a> can use their own ports, allowing two containers with Apache on port 80 to run on different ports simultaneously.<\/p>\n\n\n\n<p><span style=\"color: #000000;\"><strong>[DOCKER IN DOCKER\u2019s TERM\u2026]<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"color: #000000;\"><strong>BUILD ONCE, CONFIGURE ONCE &amp; RUN ANYWHERE\u2026\u2026..<\/strong><\/span><\/p>\n\n\n\n<p>There is also one more component in docker <strong>DOCKER INDEX\u2026.<\/strong><\/p>\n\n\n\n<p><strong>You must be thinking about what the Docker index is.<\/strong><\/p>\n\n\n\n<p>Let&#8217;s talk about the docker index, it is basically a git repository that contains docker containers and all. You can push containers in that repository or pull containers just like git.<\/p>\n\n\n\n<p><strong>These all points make Docker so attractive\u2026.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Now let&#8217;s talk about how does docker work?<\/h2>\n\n\n\n<p>Let me tell you one thing Docker\u2019s commands are too simple and user-friendly. You only just need to understand the flow of its commands.<\/p>\n\n\n\n<p>ok, let&#8217;s install docker in your ubuntu os machine\u2026.<\/p>\n\n\n\n<p>First, open the terminal and go to the root user by typing:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -s<\/pre>\n\n\n\n<p>then update your system by typing:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get update<\/pre>\n\n\n\n<p>Now check curl if it is not installed then type:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install curl<\/pre>\n\n\n\n<p>Get the latest Docker package&nbsp;<span style=\"line-height: 1.5;\">with the mentioned command:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -sSL https:\/\/get.docker.com\/ | sh<\/pre>\n\n\n\n<p>now verify whether the Docker is installed or not, type:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker --version<\/pre>\n\n\n\n<p><strong>docker version should be 20.10.22.<\/strong><\/p>\n\n\n\n<p><span style=\"color: #000000;\">[Note: you can get lots of ways to install docker in just a few commands but to install an updated version, follow the procedure.]<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Now let&#8217;s learn how to run the docker<\/strong><\/h2>\n\n\n\n<p>First, you have to download the docker\u2019s image like I want to download the ubuntu-20.04 image then download it by typing:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker pull ubuntu:20.04<\/pre>\n\n\n\n<p>it will pull the image from the dockerhub<\/p>\n\n\n\n<p>After pulling it, you can list the images by typing:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker images<\/pre>\n\n\n\n<p>Then, it will show you the complete downloaded images that you have in your system<\/p>\n\n\n\n<p>after that just hit the command to use docker\u2019s image:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker run -i -t ubuntu:20.04<\/pre>\n\n\n\n<p>The command gives you a terminal to run or install anything. To save changes, you must commit the container by opening another terminal and typing as the root user:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker commit your_container_id your_container-name<\/pre>\n\n\n\n<p>now the question arises how do we get to know the container\u2019s ID &amp; container\u2019s name?<\/p>\n\n\n\n<p>Here, you can check your container\u2019s ID and name by typing:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker ps<\/pre>\n\n\n\n<p>after committing it, your container is ready to use.<\/p>\n\n\n\n<p><span style=\"color: #000000;\"><strong>[ Note: <\/strong><\/span>Remember, don&#8217;t exit or run another container without committing your changes, or you&#8217;ll lose your work. Use <code>docker commit<\/code> to save your changes.<span style=\"color: #000000;\"><strong> ]<\/strong><\/span><\/p>\n\n\n\n<p>now if you want to run your container in daemonize mode then you have to hit the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker run -i -d container_name<\/pre>\n\n\n\n<p>To stop running the container:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker stop container_id<\/pre>\n\n\n\n<p>To remove the container:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker rm container-id<\/pre>\n\n\n\n<p>&nbsp;All basic commands are:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">attach:-Attach to a running containerit<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Terminologies &#8211;<\/h2>\n\n\n\n<ul>\n<li>build:-Build a container from a Dockerfile<\/li>\n\n\n\n<li>commit:-Create a new image from a container\u2019s changes<\/li>\n\n\n\n<li>cp:-Copy files\/folders from the container&#8217;s filesystem to the host path<\/li>\n\n\n\n<li>diff:-Inspect changes on a container\u2019s filesystem<\/li>\n\n\n\n<li>events:-Get real-time events from the server<\/li>\n\n\n\n<li>export:-Stream the contents of a container as a tar archive<\/li>\n\n\n\n<li>history:-Show the history of an image<\/li>\n\n\n\n<li>images:-List images<\/li>\n\n\n\n<li>import:-Create a new filesystem image from the contents of a tarball<\/li>\n\n\n\n<li>info:-Display system-wide information<\/li>\n\n\n\n<li>insert:-Insert a file in an image<\/li>\n\n\n\n<li>inspect:-Return low-level information on a container<\/li>\n\n\n\n<li>kill:-Kill a running container<\/li>\n\n\n\n<li>load:-Load an image from a tar archive<\/li>\n\n\n\n<li>login:-Register or Login to the docker registry server<\/li>\n\n\n\n<li>logs:-Fetch the logs of a container<\/li>\n\n\n\n<li>port:-Lookup the public-facing port which is NAT-ed to PRIVATE_PORT<\/li>\n\n\n\n<li>ps:-List containers<\/li>\n\n\n\n<li>pull:-Pull an image or a repository from the docker registry server<\/li>\n\n\n\n<li>push:-Push an image or a repository to the docker registry server<\/li>\n\n\n\n<li>restart:-Restart a running container<\/li>\n\n\n\n<li>rm:-Remove one or more containers<\/li>\n\n\n\n<li>rmi:-Remove one or more images<\/li>\n\n\n\n<li>run:-Run a command in a new container<\/li>\n\n\n\n<li>save:-Save an image to a tar archive<\/li>\n\n\n\n<li>search:-Search for an image in the docker index<\/li>\n\n\n\n<li>start:-Start a stopped container<\/li>\n\n\n\n<li>stop:-Stop a running container<\/li>\n\n\n\n<li>tag:-Tag an image into a repository<\/li>\n\n\n\n<li>top:-Lookup the running processes of a container<\/li>\n\n\n\n<li>version:-Show the docker version information<\/li>\n\n\n\n<li>wait:-Block until a container stops, then print its exit code<\/li>\n<\/ul>\n\n\n\n<p>In the next blog, you can learn <a href=\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/\">how to host a website on a Docker container.<\/a><\/p>\n\n\n\n<p><strong>You may also visit our Magento development services and quality\u00a0<\/strong> <strong><a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 Extensions<\/a><\/strong>.<\/p>\n\n\n\n<p><strong>For further help or queries, please\u00a0<a href=\"https:\/\/cloudkul.com\/contact\/\">contact<\/a>\u00a0us or raise a\u00a0<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">ticket<\/a>.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s talk about Docker. As you have read in earlier blogs. What exactly docker is? <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":4,"featured_media":326,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[5],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Start your journey with Docker....!!! - Cloudkul<\/title>\n<meta name=\"description\" content=\"Docker is a lightweight application that shared kernels with the base machine to virtualized the environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Start your journey with Docker....!!! - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Docker is a lightweight application that shared kernels with the base machine to virtualized the environment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-04T08:23:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-23T11:44:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2015\/11\/Start-Your-Journey-With-Docker.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prashant Arora\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/\",\"name\":\"Start your journey with Docker....!!! - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2023-01-04T08:23:05+00:00\",\"dateModified\":\"2024-12-23T11:44:33+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822\"},\"description\":\"Docker is a lightweight application that shared kernels with the base machine to virtualized the environment.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Start your journey with Docker&#8230;.!!!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822\",\"name\":\"Prashant Arora\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Prashant Arora\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/prashant089\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Start your journey with Docker....!!! - Cloudkul","description":"Docker is a lightweight application that shared kernels with the base machine to virtualized the environment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/","og_locale":"en_US","og_type":"article","og_title":"Start your journey with Docker....!!! - Cloudkul","og_description":"Docker is a lightweight application that shared kernels with the base machine to virtualized the environment.","og_url":"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/","og_site_name":"Cloudkul","article_published_time":"2023-01-04T08:23:05+00:00","article_modified_time":"2024-12-23T11:44:33+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2015\/11\/Start-Your-Journey-With-Docker.png","type":"image\/png"}],"author":"Prashant Arora","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/","url":"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/","name":"Start your journey with Docker....!!! - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2023-01-04T08:23:05+00:00","dateModified":"2024-12-23T11:44:33+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822"},"description":"Docker is a lightweight application that shared kernels with the base machine to virtualized the environment.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Start your journey with Docker&#8230;.!!!"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822","name":"Prashant Arora","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Prashant Arora"},"url":"https:\/\/cloudkul.com\/blog\/author\/prashant089\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/150"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":41,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":19205,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/150\/revisions\/19205"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/326"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}