linux安装docker
·
CentOS 安装 Docker
- 卸载旧版本
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine -y
- 安装依赖
yum install -y yum-utils
- 设置阿里云 Docker 源
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- 安装 Docker 引擎
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
- 启动 + 开机自启
systemctl start docker
systemctl enable docker
Ubuntu 安装 Docker
apt update
apt install ca-certificates curl gnupg lsb-release -y
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
systemctl start docker
systemctl enable docker
注:docker镜像加速
- 找到daemon.json,没有就自己创建,具体位置按安装方式自行搜索一下
- 写入内容,如下:
{
"registry-mirrors": [
"https://docker.1panel.live",
"https://docker-0.unsee.tech",
"https://docker.1panel.live",
"https://registry.dockermirror.com",
"https://docker.imgdb.de",
"https://docker.m.daocloud.io",
"https://hub.firefly.store",
"https://hub.littlediary.cn",
"https://hub.rat.dev",
"https://dhub.kubesre.xyz",
"https://cjie.eu.org",
"https://docker.kejilion.pro",
"https://docker.1panelproxy.com",
"https://docker.hlmirror.com",
"https://hub.fast360.xyz",
"https://ghcr.io"
]
}
- 重启docker即可
更多推荐
所有评论(0)