扫码阅读
手机扫码阅读

云计算--Docker在Ubuntu上安装

119 2024-07-19

我们非常重视原创文章,为尊重知识产权并避免潜在的版权问题,我们在此提供文章的摘要供您初步了解。如果您想要查阅更为详尽的内容,访问作者的公众号页面获取完整文章。

查看原文:云计算--Docker在Ubuntu上安装
文章来源:
springboot葵花宝典
扫码关注公众号
Docker Installation on Ubuntu Summary

Ubuntu System Requirements

Docker is supported on various Ubuntu operating systems including Ubuntu Hirsute 21.04, Groovy 20.10, Disco 19.04, and Bionic 18.04 (LTS), among other updated versions. It can be installed on 64-bit x86 or ARM platforms. Long-Term Support (LTS) versions of Ubuntu, offering 5 years of maintenance support, are recommended for production environments due to their stability.

Docker Installation

Automated Installation

Automated scripts can be used for installation, such as the one from Aliyun:

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

After installation, the Docker version can be checked with:

docker version

Alternatively, Daocloud's one-click installation script is also available:

curl -sSL https://get.daocloud.io/docker | sh

For any installation method used, if switching to another installation method, the previous Docker version must be uninstalled first:

sudo apt-get remove docker docker-engine docker.io containerd runc

Manual Installation

For manual installation using apt-get, system tools and GPG certificates must be installed, and the Aliyun stable repository should be set up:

sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

Then, Docker-CE, Docker Engine-Community, and containerd can be updated and installed:

sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce docker-ce-cli containerd.io

Available versions of Docker-ce can be viewed in the repository, and a specific version can be installed as needed:

apt-cache madison docker-ce
sudo apt-get -y install docker-ce=[VERSION]

Testing Docker with Nginx

To test Docker, an Nginx image can be pulled and run:

docker pull nginx:latest
docker images
docker run --name nginx-test -p 8080:80 -d nginx
docker ps

The running container's details will be displayed, and Nginx can be accessed at the server's IP address on port 8080.

想要了解更多内容?

查看原文:云计算--Docker在Ubuntu上安装
文章来源:
springboot葵花宝典
扫码关注公众号