1.Docker安装
docker阿里云镜像站下载:docker-toolbox安装包下载_开源镜像站-阿里云
linux直接安装:
sudo apt-get install docker.io
安装完成后可以输入docker version验证:
root@master1:~# docker version
Client:
Version: 24.0.7
API version: 1.43
Go version: go1.21.1
Git commit: 24.0.7-0ubuntu2~22.04.1
Built: Wed Mar 13 20:23:54 2024
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.7
API version: 1.43 (minimum version 1.12)
Go version: go1.21.1
Git commit: 24.0.7-0ubuntu2~22.04.1
Built: Wed Mar 13 20:23:54 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.12
GitCommit:
runc:
Version: 1.1.12-0ubuntu2~22.04.1
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
2.国内镜像源替换
windows或mac安装了docker desktop的可以直接在docker engine中修改,Linux在/etc/docker/daemon.json中修改,添加
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://docker.1panel.live",
"https://<阿里云镜像>.mirror.aliyuncs.com"
]
3.阿里云镜像仓库申请
阿里云搜索:容器镜像服务->镜像工具->镜像加速器
4.拉一个镜像试试
若要指定镜像仓库拉取的话需要加上镜像仓库名(如https://registry.cn-hangzhou.aliyuncs.com/
),否则默认从dockerhub拉取。
root@master1:~# docker pull busybox
输入docker images可以查看本地的镜像: