在 Mac 上安装和运行 Docker Desktop?
下载网址:https://docs.docker.com/desktop/mac/install/
1.双击Docker.dmg 打开安装程序,然后将 Docker 图标拖到 Applications 文件夹。
双击Docker.app Applications 文件夹以启动 Docker。在下面的示例中,Applications 文件夹处于“网格”视图模式。
?在 Windows?上安装和运行 Docker Desktop?
下载网址:https://docs.docker.com/desktop/windows/release-notes/#docker-desktop-444
1.打开 Hyper-V
?
?
2.在?General? 关闭 WSL2 和设置 docker 开机自启动?
关闭 Use the WSL 2 based engine
打开 Start Docker Desktop when you log in
3.在 Resources File sharing 设置目录
D:\docker
4. 在 Docker Engine 设置镜像仓库
"registry-mirrors": [
? ? "http://f1361db2.m.daocloud.io",
? ? "https://registry.docker-cn.com",
? ? "http://hub-mirror.c.163.com",
? ? "https://docker.mirrors.ustc.edu.cn"
]
?在 CentOS上安装和运行 Docker
1.安装docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
2.启动 Docker
sudo systemctl start docker
3. 设置仓库
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
4.设置淘宝镜像
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5.加速器
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://5xu8s5yw.mirror.aliyuncs.com"]
}
EOF
6.重启
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl enable docker
7.安装 compose
sudo curl -L "https://get.daocloud.io/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
?在 Ubuntu 上安装和运行 Docker
1.查看内核版本详细信息
uname -a
cat /proc/version
2.安装 docker
sudo curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
3.安装 docker-compose
sudo apt install docker-compose
sudo docker-compose --version
?4.切换国内镜像
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://5xu8s5yw.mirror.aliyuncs.com"]
}
EOF
5.重启
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl enable docker
6.将登陆用户加入到docker用户组中、更新用户组
sudo usermod -aG docker ubuntu
newgrp docker
|