{"id":7955,"date":"2022-03-01T14:09:54","date_gmt":"2022-03-01T06:09:54","guid":{"rendered":"http:\/\/mohan.sg\/?p=7955"},"modified":"2022-03-01T14:09:54","modified_gmt":"2022-03-01T06:09:54","slug":"install-docker-ce-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7955","title":{"rendered":"Install Docker CE on Rocky Linux 8"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"installing-docker-ce-on-rocky-linux-8\">Installing Docker CE on Rocky Linux 8<\/h2>\n\n\n\n<p>Docker has a dedicated CentOS repository that we can apply to Rocky Linux. So, the ideal would be to add it to the system and install it from there.<\/p>\n\n\n\n<p>First access your server via SSH or, if you are using Rocky Linux from the desktop, open a terminal.<\/p>\n\n\n\n<p>Now install the&nbsp;<code>yum-utils<\/code>&nbsp;package.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo dnf install yum-utils<\/strong><\/code><\/pre>\n\n\n\n<p>With this package installed, we can add the Docker repository.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum-config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<\/code><\/pre>\n\n\n\n<p>Output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Adding repo from: https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<\/code><\/pre>\n\n\n\n<p>If you want to check if the repository has been successfully added, you can run<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf repolist<\/code><\/pre>\n\n\n\n<p>sudo dnf install docker-ce docker-ce-cli containerd.io<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>With this process, Docker is already installed, but its service is not started.<\/p>\n\n\n\n<p>To start the Docker service, run<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start docker<\/code><\/pre>\n\n\n\n<p>It is convenient that the service starts with the system, to do this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable docker<\/code><\/pre>\n\n\n\n<p>Output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/docker.service ? \/usr\/lib\/systemd\/system\/system\/docker.service<\/code><\/pre>\n\n\n\n<p>Finally, you can check the status of the service<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status docker<\/code><\/pre>\n\n\n\n<p>In conclusion, Docker is installed correctly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"first-steps-with-docker-ce-on-rocky-linux\">First steps with Docker CE on Rocky Linux<\/h2>\n\n\n\n<p>Using Docker requires root permissions. This can be a problem for many people, so a real option would be to add the user to the&nbsp;<code>docker<\/code>&nbsp;group.<\/p>\n\n\n\n<p>To complete this, run the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -aG docker $USER<\/code><\/pre>\n\n\n\n<p>Now, you can run Docker and for this you can use the test image.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run hello-world<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p> Installing Docker CE on Rocky Linux 8 <\/p>\n<p>Docker has a dedicated CentOS repository that we can apply to Rocky Linux. So, the ideal would be to add it to the system and install it from there.<\/p>\n<p>First access your server via SSH or, if you are using Rocky Linux from the desktop, open a [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7955"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7955"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7955\/revisions"}],"predecessor-version":[{"id":7957,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7955\/revisions\/7957"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}