Home  >  Article  >  Computer Tutorials  >  Tutorial on compiling and installing Docker on Ubuntu 18.04 system.

Tutorial on compiling and installing Docker on Ubuntu 18.04 system.

WBOY
WBOYforward
2024-02-19 14:03:021041browse

Ubuntu 18.04系统编译安装Docker教程。

The following is a tutorial for compiling and installing Docker on Ubuntu 18.04 system:

  1. Uninstall the old version of Docker (if installed):

    sudo apt remove docker docker-engine docker.io containerd runc
  2. Update system packages:

    sudo apt update
    sudo apt upgrade
  3. Install Docker dependencies:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  4. Add Docker’s official GPG key:

    curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  5. Add Docker official software source:

    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] (lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  6. Update package index:

    sudo apt update
  7. Install Docker:

    sudo apt install docker-ce docker-ce-cli containerd.io
  8. Add the current user to the docker user group (optional, allow non-admin users to run Docker commands):

    sudo usermod -aG docker $USER
  9. Log in again or restart the system to make the user group changes take effect.
  10. Verify whether the Docker installation is successful:

    docker --version

    If the installation is successful, Docker version information will be displayed.

Now, you have successfully compiled and installed Docker on Ubuntu 18.04. Please make sure you have the necessary permissions when running Docker commands as a normal user. Please note that installation and use of Docker may require specific network configuration and other settings depending on your application needs.

Please note that Docker installed through compilation and installation will not be updated automatically. You need to manually update the version or perform maintenance. In addition, you can consider using the Docker version provided by the system package manager for more convenient updates and management.

The above is the detailed content of Tutorial on compiling and installing Docker on Ubuntu 18.04 system.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete