{"id":714,"date":"2016-09-26T06:42:12","date_gmt":"2016-09-26T06:42:12","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=714"},"modified":"2026-07-31T02:58:33","modified_gmt":"2026-07-31T02:58:33","slug":"docker-installation","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2016\/09\/26\/docker-installation\/","title":{"rendered":"Docker Installation"},"content":{"rendered":"<p>For linux, download from <a href=\"http:\/\/docs.docker.com\/engine\/installation\/linux\/\" target=\"_blank\" rel=\"noopener\">http:\/\/docs.docker.com\/engine\/installation\/linux\/<\/a>. For Ubuntu, read and follow the step <a href=\"https:\/\/docs.docker.com\/engine\/installation\/linux\/ubuntulinux\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<ol>\n<li>Check the kernel machine. The kernel should be newer than 3.1. Also docker requires 64-bit Ubuntu.\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ uname -r\r\n4.4.0-38-generic<\/pre>\n<p>My kernel version is 4.4.0-38 (<span style=\"background-color: #008000;\">PASS<\/span>)<\/li>\n<li>Update APT source<br \/>\nUpdate system<\/p>\n<pre class=\"lang:default decode:true \">sudo apt-get update<\/pre>\n<p>Update package information, ensure that APT works with the https method, and that CA certificates are installed.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-get install apt-transport-https ca-certificates\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\napt-transport-https is already the newest version.\r\nca-certificates is already the newest version.\r\nca-certificates set to manually installed.<\/pre>\n<p>Add the new GPG key<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-key adv --keyserver hkp:\/\/p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D\r\nExecuting: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir \/tmp\/tmp.WSnymkJUMh --no-auto-check-trustdb --trust-model always --keyring \/etc\/apt\/trusted.gpg --primary-keyring \/etc\/apt\/trusted.gpg --keyring \/etc\/apt\/trusted.gpg.d\/alexmurray-indicator-sensors-daily.gpg --keyring \/etc\/apt\/trusted.gpg.d\/bhdouglass-indicator-remindor.gpg --keyring \/etc\/apt\/trusted.gpg.d\/damien-moore-codeblocks-stable.gpg --keyring \/etc\/apt\/trusted.gpg.d\/danielrichter2007-grub-customizer.gpg --keyring \/etc\/apt\/trusted.gpg.d\/font-manager-staging.gpg --keyring \/etc\/apt\/trusted.gpg.d\/geany-dev-ppa.gpg --keyring \/etc\/apt\/trusted.gpg.d\/george-edison55-nitroshare.gpg --keyring \/etc\/apt\/trusted.gpg.d\/jfi-psensor-unstable.gpg --keyring \/etc\/apt\/trusted.gpg.d\/kirillshkrogalev-ffmpeg-next.gpg --keyring \/etc\/apt\/trusted.gpg.d\/linrunner-tlp.gpg --keyring \/etc\/apt\/trusted.gpg.d\/maarten-baert-simplescreenrecorder.gpg --keyring \/etc\/apt\/trusted.gpg.d\/mc3man-trusty-media.gpg --keyring \/etc\/apt\/trusted.gpg.d\/n-muench-programs-ppa2.gpg --keyring \/etc\/apt\/trusted.gpg.d\/obsproject-obs-studio.gpg --keyring \/etc\/apt\/trusted.gpg.d\/ondrej-php.gpg --keyring \/etc\/apt\/trusted.gpg.d\/ondrej-php5-5_6.gpg --keyring \/etc\/apt\/trusted.gpg.d\/ondrej-php5-compat.gpg --keyring \/etc\/apt\/trusted.gpg.d\/osmoma-audio-recorder.gpg --keyring \/etc\/apt\/trusted.gpg.d\/recoll-backports-recoll-1_15-on.gpg --keyring \/etc\/apt\/trusted.gpg.d\/tsvetko_tsvetkov-trusty-backports.gpg --keyring \/etc\/apt\/trusted.gpg.d\/tuxonice-ppa.gpg --keyring \/etc\/apt\/trusted.gpg.d\/ubuntu-audio-dev-alsa-daily.gpg --keyring \/etc\/apt\/trusted.gpg.d\/umang-indicator-stickynotes.gpg --keyring \/etc\/apt\/trusted.gpg.d\/webupd8team-brackets.gpg --keyring \/etc\/apt\/trusted.gpg.d\/webupd8team-java.gpg --keyring \/etc\/apt\/trusted.gpg.d\/wine-wine-builds.gpg --keyring \/etc\/apt\/trusted.gpg.d\/xorg-edgers-ppa.gpg --keyserver hkp:\/\/p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D\r\ngpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net\r\n?: p80.pool.sks-keyservers.net: Host not found\r\ngpgkeys: HTTP fetch error 7: couldn't connect: Success\r\ngpg: no valid OpenPGP data found.\r\ngpg: Total number processed: 0<\/pre>\n<p>Then Open the \/etc\/apt\/sources.list.d\/docker.list file in your favorite editor. If the file doesn\u2019t exist, create it.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo gedit \/etc\/apt\/sources.list.d\/docker.list<\/pre>\n<p>Make sure the file is empty or remove any existing entries. Add this on file for Ubuntu Trusty 14.04 (LTS)<\/p>\n<pre class=\"lang:default decode:true \">deb https:\/\/apt.dockerproject.org\/repo ubuntu-trusty main<\/pre>\n<p>Save and close the file.<br \/>\nUpdate the system<\/p>\n<pre class=\"lang:default decode:true \">sudo apt-get update<\/pre>\n<p>Purge the old repo if it exists.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-get purge lxc-docker\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nPackage 'lxc-docker' is not installed, so not removed\r\n...<\/pre>\n<p>Verify that APT is pulling from the right repository.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ apt-cache policy docker-engine\r\ndocker-engine:\r\n  Installed: (none)\r\n  Candidate: 1.12.1-0~trusty\r\n  Version table:\r\n     1.12.1-0~trusty 0\r\n        500 https:\/\/apt.dockerproject.org\/repo\/ ubuntu-trusty\/main amd64 Packages\r\n     1.12.0-0~trusty 0\r\n        500 https:\/\/apt.dockerproject.org\/repo\/ ubuntu-trusty\/main amd64 Packages\r\n     ...<\/pre>\n<p>CONT&#8230;.<\/li>\n<\/ol>\n<p>20260730<\/p>\n<p>Install Docker on Ubuntu 22.04<\/p>\n<pre class=\"lang:default decode:true \">satria@teddy:~$ sudo apt install docker.io -y\r\n[sudo] password for satria: \r\nReading package lists... Done\r\nBuilding dependency tree... Done\r\nReading state information... Done\r\nSome packages could not be installed. This may mean that you have\r\nrequested an impossible situation or if you are using the unstable\r\ndistribution that some required packages have not yet been created\r\nor been moved out of Incoming.\r\nThe following information may help to resolve the situation:\r\n\r\nThe following packages have unmet dependencies:\r\n containerd.io : Conflicts: containerd\r\nE: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.<\/pre>\n<p>It looks like you&#8217;ve run into a package conflict while trying to install Docker. This is a common issue on Ubuntu and can be resolved by removing the conflicting package and then using Docker&#8217;s official installation repository, which is the recommended method.<\/p>\n<p>The error\u00a0<code class=\"chat-markdown-code-inline\">containerd.io : Conflicts: containerd<\/code>\u00a0means that a package required by\u00a0<code class=\"chat-markdown-code-inline\">docker.io<\/code>\u00a0(which is\u00a0<code class=\"chat-markdown-code-inline\">containerd.io<\/code>) conflicts with a version of\u00a0<code class=\"chat-markdown-code-inline\">containerd<\/code>\u00a0that is already on your system or available in a different repository.<\/p>\n<p>Here is a step-by-step guide to fix this and get Docker installed correctly.<\/p>\n<h3>Step 1: Uninstall Old and Conflicting Packages<\/h3>\n<p>First, let&#8217;s remove the conflicting\u00a0<code class=\"chat-markdown-code-inline\">containerd<\/code>\u00a0package and any other old Docker-related packages to ensure a clean slate.<\/p>\n<div class=\"remix-chat-code-block\">\n<div class=\"codeblock-toolbar-wrapper\">\n<div class=\"codeblock-toolbar-wrapper-border\">\n<div class=\"toolbar\"><\/div>\n<\/div>\n<\/div>\n<pre class=\"content\"><code><span class=\"token\">sudo<\/span> <span class=\"token\">apt-get<\/span> remove <span class=\"token\">docker<\/span> docker-engine docker.io containerd runc\r\n<\/code><\/pre>\n<\/div>\n<h3>Step 2: Set Up the Official Docker Repository<\/h3>\n<p>Instead of using\u00a0<code class=\"chat-markdown-code-inline\">docker.io<\/code>\u00a0from the default Ubuntu repository, it&#8217;s best to use the official Docker repository. This ensures you get the latest version and avoid conflicts.<\/p>\n<ol>\n<li><strong>Update your package list and install prerequisites:<\/strong>\n<div class=\"remix-chat-code-block\">\n<div class=\"codeblock-toolbar-wrapper\">\n<div class=\"codeblock-toolbar-wrapper-border\">\n<div class=\"toolbar\"><\/div>\n<\/div>\n<\/div>\n<pre class=\"content\"><code><span class=\"token\">sudo<\/span> <span class=\"token\">apt-get<\/span> update\r\n<span class=\"token\">sudo<\/span> <span class=\"token\">apt-get<\/span> <span class=\"token\">install<\/span> ca-certificates <span class=\"token\">curl<\/span>\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li><strong>Add Docker\u2019s official GPG key:<\/strong>\n<div class=\"remix-chat-code-block\">\n<div class=\"codeblock-toolbar-wrapper\">\n<div class=\"codeblock-toolbar-wrapper-border\">\n<div class=\"toolbar\"><\/div>\n<\/div>\n<\/div>\n<pre class=\"content\"><code><span class=\"token\">sudo<\/span> <span class=\"token\">install<\/span> -m 0755 -d \/etc\/apt\/keyrings\r\n<span class=\"token\">sudo<\/span> <span class=\"token\">curl<\/span> -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc\r\n<span class=\"token\">sudo<\/span> <span class=\"token\">chmod<\/span> a+r \/etc\/apt\/keyrings\/docker.asc\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li><strong>Set up the repository:<\/strong>\n<div class=\"remix-chat-code-block\">\n<pre class=\"content\"><code><span class=\"token\">echo<\/span> <span class=\"token\">\\<\/span>\r\n  <span class=\"token\">\"deb [arch=<\/span><span class=\"token\">$(<\/span><span class=\"token\">dpkg --print-architecture<\/span><span class=\"token\">)<\/span><span class=\"token\"> signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/ubuntu \\\r\n<\/span>  <span class=\"token\">$(<\/span><span class=\"token\">.<\/span><span class=\"token\"> \/etc\/os-release <\/span><span class=\"token\">&amp;&amp;<\/span> <span class=\"token\">echo<\/span> <span class=\"token\">\"<\/span><span class=\"token\">$VERSION_CODENAME<\/span><span class=\"token\">\"<\/span><span class=\"token\">)<\/span><span class=\"token\"> stable\"<\/span> <span class=\"token\">|<\/span> <span class=\"token\">\\<\/span>\r\n  <span class=\"token\">sudo<\/span> <span class=\"token\">tee<\/span> \/etc\/apt\/sources.list.d\/docker.list <span class=\"token\">&gt;<\/span> \/dev\/null\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<\/ol>\n<h3>Step 3: Install Docker Engine<\/h3>\n<p>Now that the correct repository is set up, update your package list again and install the latest Docker packages.<\/p>\n<div class=\"remix-chat-code-block\">\n<pre class=\"content\"><code><span class=\"token\">sudo<\/span> <span class=\"token\">apt-get<\/span> update\r\n<span class=\"token\">sudo<\/span> <span class=\"token\">apt-get<\/span> <span class=\"token\">install<\/span> docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y\r\n<\/code><\/pre>\n<\/div>\n<h3>Step 4: (Optional but Recommended) Manage Docker as a Non-Root User<\/h3>\n<p>To avoid having to type\u00a0<code class=\"chat-markdown-code-inline\">sudo<\/code>\u00a0every time you run a Docker command, add your user to the\u00a0<code class=\"chat-markdown-code-inline\">docker<\/code>\u00a0group.<\/p>\n<div class=\"remix-chat-code-block\">\n<pre class=\"content\"><code><span class=\"token\">sudo<\/span> <span class=\"token\">groupadd<\/span> <span class=\"token\">docker<\/span>\r\n<span class=\"token\">sudo<\/span> <span class=\"token\">usermod<\/span> -aG <span class=\"token\">docker<\/span> <span class=\"token environment\">$USER<\/span>\r\n<\/code><\/pre>\n<\/div>\n<p><strong>Important:<\/strong>\u00a0You will need to log out and log back in for this group change to take effect.<\/p>\n<p>After following these steps, Docker should be installed correctly. You can verify it by running:<\/p>\n<div class=\"remix-chat-code-block\">\n<pre class=\"content\"><code><span class=\"token\">docker<\/span> run hello-world\r\n<\/code><\/pre>\n<\/div>\n<p>Once Docker is running, you can proceed with the SonarQube setup I outlined previously, starting with the\u00a0<code class=\"chat-markdown-code-inline\">docker run<\/code>\u00a0command for SonarQube. Let me know if you encounter any other issues<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For linux, download from http:\/\/docs.docker.com\/engine\/installation\/linux\/. For Ubuntu, read and follow the step here. Check the kernel machine. The kernel should be newer than 3.1. Also docker requires 64-bit Ubuntu. teddy@teddy-K43SJ:~$ uname -r 4.4.0-38-generic My kernel version is 4.4.0-38 (PASS) Update APT source Update system sudo apt-get update Update package information, ensure that APT works with &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2016\/09\/26\/docker-installation\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Docker Installation&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[],"class_list":["post-714","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=714"}],"version-history":[{"count":7,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/714\/revisions"}],"predecessor-version":[{"id":14248,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/714\/revisions\/14248"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}