The following is a tutorial for compiling and installing Docker on Ubuntu 18.04 system:
Uninstall the old version of Docker (if installed):
sudo apt remove docker docker-engine docker.io containerd runc
Update system packages:
sudo apt update sudo apt upgrade
Install Docker dependencies:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Add Docker’s official GPG key:
curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
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
Update package index:
sudo apt update
Install Docker:
sudo apt install docker-ce docker-ce-cli containerd.io
Add the current user to the docker user group (optional, allow non-admin users to run Docker commands):
sudo usermod -aG docker $USER
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!