Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock3/dev/install-docker-engineer-on-docker"

< Rock3‎ | dev
(1.Install Docker Engine on Debian)
 
Line 3: Line 3:
 
{{Languages|rock3/dev/install-docker-engineer-on-docker}}
 
{{Languages|rock3/dev/install-docker-engineer-on-docker}}
  
=== 1.Install Docker Engine on Debian ===
+
=== 1.Install Docker on Debian ===
0 Uninstall old versions
+
  sudo apt-get remove docker docker-engine docker.io containerd runc
+
1 Install using the repository.Update the apt package index and install packages to allow apt to use a repository over HTTPS:
+
 
   sudo apt-get update
 
   sudo apt-get update
   sudo apt-get install \
+
   sudo apt-get install docker.io
    ca-certificates \
+
    curl \
+
    gnupg \
+
    lsb-release
+
2 Add Docker’s official GPG key:
+
  sudo mkdir -p /etc/apt/keyrings
+
  curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
+
3 Use the following command to set up the repository:
+
  echo \
+
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
+
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+
4 Install Docker Engine
+
  sudo apt-get update
+
  sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
+
 
+
Please note that you may meet this error log. Please ignore it.
+
 
+
<pre>
+
# sudo apt-get check docker-ce docker-ce-cli containerd.io docker-compose-plugin
+
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
+
root@rak-gateway:/home/rock# dpkg --configure -a
+
Setting up docker-ce (5:20.10.17~3-0~debian-buster) ...
+
Job for docker.service failed because the control process exited with error code.
+
See "systemctl status docker.service" and "journalctl -xe" for details.
+
invoke-rc.d: initscript docker, action "start" failed.
+
● docker.service - Docker Application Container Engine
+
  Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
+
  Active: activating (auto-restart) (Result: exit-code) since Thu 2022-07-14 07:32:13 UTC; 22ms ago
+
    Docs: https://docs.docker.com
+
  Process: 1735 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
+
Main PID: 1735 (code=exited, status=1/FAILURE)
+
dpkg: error processing package docker-ce (--configure):
+
installed docker-ce package post-installation script subprocess returned error exit status 1
+
Errors were encountered while processing:
+
docker-ce
+
</pre>
+
 
+
5 The docker installer uses iptables for nat. Unfortunately Debian uses nftables. You can convert the entries over to nftables or just setup Debian to use the legacy iptables.
+
  sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
+
  sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
+
  sudo service docker start
+
  
 
=== 2 Test Docker===
 
=== 2 Test Docker===

Latest revision as of 03:25, 16 March 2023

1.Install Docker on Debian

 sudo apt-get update
 sudo apt-get install docker.io

2 Test Docker

 sudo docker run hello-world

3 Check docker service status

 sudo systemctl status docker

And it shows this.

 ● docker.service - Docker Application Container Engine
  Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
  Active: active (running) since Thu 2022-07-14 15:24:57 UTC; 4min 48s ago
    Docs: https://docs.docker.com
Main PID: 5632 (dockerd)
   Tasks: 10
  Memory: 37.4M
  CGroup: /system.slice/docker.service
          └─5632 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contain