Location>code7788 >text

Ubuntu Local Installation of Docker

Popularity:619 ℃/2024-07-22 10:00:19

Ubuntu Local Installation of Docker

catalogs
  • Ubuntu Local Installation of Docker
    • View Ubuntu system version designators
    • mounting
    • Modifying the mirror source

Official Documentation:Install Docker Engine on Ubuntu | Docker Docs

  • Ubuntu 18.04 Docker installation package
  • Ubuntu 20.04 Docker installation package
  • Ubuntu 22.04 Docker installation package
  • Ubuntu 24.04 Docker installation package

View Ubuntu system version designators

Common Version Codes

releases Codename
18.04 bionic
20.04 focal
22.04 jammy
24.04 noble

manual view

lsb_release -a
# or
lsb_release -c

Codenameis the version code, 24.04 here is thenoble

image

mounting

  1. Upload the package under the corresponding version code to a folder on the server

    image

  2. The server enters the folder and executes the command

    The installation order can be: containerd, docker-ce-cli, docker-buildx-plugin, docker-ce, docker-compose-plugin, you can change the installation order if you encounter installation failure.

    # Note: refers to the package file, please specify your own local package file name, install one by one
    sudo dpkg -i
    
  3. activate (a plan)

    sudo service docker start
    # Set up a self-start
    sudo systemctl enable docker
    

Modifying the mirror source

The Docker image source configuration file is in the/etc/docker/

sudo vim  /etc/docker/

To edit the json file and write the mirror source address into the json array, write theReplace with the real mirror source address

{
    "registry-mirrors": [
        ""
    ]
}

Reboot to take effect

# Restart the daemon process
sudo systemctl daemon-reload
#Restart docker
sudo systemctl restart docker

Domestic third-party mirror source is almost invalid, you can configure your own proxy official mirror address

Some solutions:

cmliu/: This project is a Docker image proxy tool based on Cloudflare Workers. It can relay requests to the official Docker image repository, resolve some access restrictions and speed up access. ()

June 24 domestic Docker image source failure solution - small white can also be self-sufficient (mirror repository building) with available Docker image source - Nuggets ()