{"id":1250,"date":"2020-06-01T13:45:26","date_gmt":"2020-06-01T04:45:26","guid":{"rendered":"https:\/\/ahnbk.com\/?p=1250"},"modified":"2020-08-28T09:02:05","modified_gmt":"2020-08-28T00:02:05","slug":"installation-docker-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/ahnbk.com\/?p=1250","title":{"rendered":"Installation Docker on Ubuntu 18.04"},"content":{"rendered":"\n<p>Install the packages for dependencies.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common<\/code><\/pre>\n\n\n\n<p>Add Docker\u2019s official GPG key<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -\nOK<\/code><\/pre>\n\n\n\n<p>Add repository for installation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo add-apt-repository \"deb &#91;arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu $(lsb_release -cs) stable\"<\/code><\/pre>\n\n\n\n<p>Install<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt-get install docker-ce docker-ce-cli containerd.io<\/code><\/pre>\n\n\n\n<p>Verify the installation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo docker run hello-world\n\nUnable to find image 'hello-world:latest' locally\nlatest: Pulling from library\/hello-world\n0e03bdcc26d7: Pull complete \nDigest: sha256:6a65f928fb91fcfbc963f7aa6d57c8eeb426ad9a20c7ee045538ef34847f44f1\nStatus: Downloaded newer image for hello-world:latest\n\nHello from Docker!\nThis message shows that your installation appears to be working correctly.\n\nTo generate this message, Docker took the following steps:\n 1. The Docker client contacted the Docker daemon.\n 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n    (amd64)\n 3. The Docker daemon created a new container from that image which runs the\n    executable that produces the output you are currently reading.\n 4. The Docker daemon streamed that output to the Docker client, which sent it\n    to your terminal.\n\nTo try something more ambitious, you can run an Ubuntu container with:\n $ docker run -it ubuntu bash\n\nShare images, automate workflows, and more with a free Docker ID:\n https:&#47;&#47;hub.docker.com\/\n\nFor more examples and ideas, visit:\n https:\/\/docs.docker.com\/get-started\/\n<\/code><\/pre>\n\n\n\n<p>Add user to docker group for execute without sudo command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo usermod -aG docker `whoami`<\/code><\/pre>\n\n\n\n<p>Reboot!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ groups\n&lt;user-name> adm tty dialout cdrom sudo dip plugdev lpadmin sambashare docker<\/code><\/pre>\n\n\n\n<p>Now, you can run docker without sudo command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker run hello-world<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Install the packages for dependencies. Add Docker\u2019s official GPG key Add repository for installation Install Verify the installation Add user to docker group for execute without sudo command Reboot! Now, you can run docker without sudo command<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[296],"tags":[289,290,18],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXSW-ka","jetpack-related-posts":[],"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1250"}],"collection":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1250"}],"version-history":[{"count":2,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1250\/revisions"}],"predecessor-version":[{"id":1252,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1250\/revisions\/1252"}],"wp:attachment":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}