Facing issue in Docker installation

To install and start Docker, first run *sudo apt install docker.io*, then use **sudo systemctl start docker**, and check the status with **sudo systemctl status docker**. However, errors were encountered when trying to start the Docker service, as indicated by the logs retrieved using **sudo journalctl -u docker.service --no-pager -n 50**.

Error Logs
nvidia@nvidia-desktop:~$ sudo journalctl -u docker.service --no-pager -n 50
Jan 01 00:01:15 375-edge dockerd[1422]: time=“1970-01-01T00:01:15.728096608Z” level=warning msg=“Setting the default DROP policy on firewall reload failed, setting default policy to DROP in FORWARD chain failed: (iptables failed: ip6tables --wait -t filter -P FORWARD DROP: ip6tables v1.8.7 (legacy): can’t initialize ip6tables table filter': Table does not exist (do you need to insmod?)\nPerhaps ip6tables or your kernel needs to be upgraded.\n (exit status 3))" Jan 01 00:01:15 375-edge dockerd[1422]: time="1970-01-01T00:01:15.732966848Z" level=warning msg="Could not load necessary modules for IPSEC rules: protocol not supported" Jan 01 00:01:16 375-edge dockerd[1422]: time="1970-01-01T00:01:16.269698560Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby Jan 01 00:01:16 375-edge dockerd[1422]: failed to start daemon: Error initializing network controller: error creating default "bridge" network: Failed to program NAT chain: failed to inject DOCKER in PREROUTING chain: iptables failed: iptables --wait -t nat -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER: iptables v1.8.7 (legacy): Couldn't load match addrtype’:No such file or directory
Jan 01 00:01:16 375-edge dockerd[1422]: Try iptables -h' or 'iptables --help' for more information. Jan 01 00:01:16 375-edge dockerd[1422]: (exit status 2) Jan 01 00:01:16 375-edge systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE Jan 01 00:01:16 375-edge systemd[1]: docker.service: Failed with result 'exit-code'. Jan 01 00:01:16 375-edge systemd[1]: Failed to start Docker Application Container Engine. Jan 01 00:01:18 375-edge systemd[1]: docker.service: Scheduled restart job, restart counter is at 1. Jan 01 00:01:18 375-edge systemd[1]: Stopped Docker Application Container Engine. Jan 01 00:01:18 375-edge systemd[1]: Starting Docker Application Container Engine... Jan 01 00:01:18 375-edge dockerd[2117]: time="1970-01-01T00:01:18.359465536Z" level=info msg="Starting up" Jan 01 00:01:18 375-edge dockerd[2117]: time="1970-01-01T00:01:18.362297824Z" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf" Jan 01 00:01:18 375-edge dockerd[2117]: time="1970-01-01T00:01:18.420765472Z" level=info msg="[graphdriver] using prior storage driver: overlay2" Jan 01 00:01:18 375-edge dockerd[2117]: time="1970-01-01T00:01:18.421128544Z" level=info msg="Loading containers: start." Jan 01 00:01:21 375-edge dockerd[2117]: time="1970-01-01T00:01:21.072307232Z" level=warning msg="ip6tables is enabled, but cannot set up ip6tables chains" error="failed to create FILTER chain DOCKER: iptables failed: ip6tables --wait -t filter -N DOCKER: ip6tables v1.8.7 (legacy): can't initialize ip6tables table filter’: Table does not exist (do you need to insmod?)\nPerhaps ip6tables or your kernel needs to be upgraded.\n (exit status 3)”
Jan 01 00:01:21 375-edge dockerd[2117]: time=“1970-01-01T00:01:21.207108960Z” level=warning msg="Setting the default DROP policy on firewall reload failed, setting default policy to DROP in FORWARD chain failed: (iptables failed: ip6tables --wait -t filter -P FORWARD DROP: ip6tables v1.8.7 (legacy): can’t initialize ip6tables table filter': Table does not exist (do you need to insmod?)\nPerhaps ip6tables or your kernel needs to be upgraded.\n (exit status 3))" Jan 01 00:01:21 375-edge dockerd[2117]: time="1970-01-01T00:01:21.210669376Z" level=warning msg="Could not load necessary modules for IPSEC rules: protocol not supported" Jan 01 00:01:21 375-edge dockerd[2117]: time="1970-01-01T00:01:21.295170336Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" Jan 01 00:01:21 375-edge dockerd[2117]: time="1970-01-01T00:01:21.750113472Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby Jan 01 00:01:21 375-edge dockerd[2117]: failed to start daemon: Error initializing network controller: error creating default "bridge" network: Failed to program NAT chain: failed to inject DOCKER in PREROUTING chain: iptables failed: iptables --wait -t nat -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER: iptables v1.8.7 (legacy): Couldn't load match addrtype’:No such file or directory
Jan 01 00:01:21 375-edge dockerd[2117]: Try `iptables -h’ or ‘iptables --help’ for more information.
Jan 01 00:01:21 375-edge dockerd[2117]: (exit status 2)

Let me clarify this

When I run the command to start the docker I am getting errors in the kernel log as you can see below.

warning msg="Setting the default DROP policy on firewall reload failed, setting default policy to DROP in FORWARD chain failed: (iptables failed: ip6tables --wait -t filter -P FORWARD DROP: ip6tables v1.8.7 (legacy): can’t initialize ip6tables table filter': Table does not exist (do you need to insmod?)\nPerhaps ip6tables or your kernel needs to be upgraded.\n (exit status 3))" Jan 01 00:01:21 375-edge dockerd[2117]: time="1970-01-01T00:01:21.210669376Z" level=warning msg="Could not load necessary modules for IPSEC rules: protocol not supported" Jan 01 00:01:21 375-edge dockerd[2117]: time="1970-01-01T00:01:21.295170336Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" Jan 01 00:01:21 375-edge dockerd[2117]: time="1970-01-01T00:01:21.750113472Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby Jan 01 00:01:21 375-edge dockerd[2117]: failed to start daemon: Error initializing network controller: error creating default "bridge" network: Failed to program NAT chain: failed to inject DOCKER in PREROUTING chain: iptables failed: iptables --wait -t nat -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER: iptables v1.8.7 (legacy): Couldn't load match addrtype’:No such file or directory
Jan 01 00:01:21 375-edge dockerd[2117]: Try `iptables -h’ or ‘iptables --help’ for more info