Ubuntu系统-应用安装篇
First Post:
Last Update:
Last Update:
Ubuntu系统-应用安装篇
Docker
官方文档: Install Docker Engine on Ubuntu | Docker Documentation
设置源仓库
更新
apt
和安装使用HTTPS的依赖:1
2sudo apt-get update
sudo apt-get install ca-certificates curl gnupg添加官方公钥 GPG key:
1
2
3sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg设置源仓库:
1
2
3
4echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
安装 Docker Engine
更新
apt
目录:1
sudo apt-get update
安装 Docker Engine, containerd, and Docker Compose.
安装最新版:
1
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
测试是否安装成功通过新建
hello-world
镜像.1
sudo docker run hello-world
该命令下载并运行了一个测试镜像. 当它运行后会输出消息并退出。
配置国内镜像
1 |
|