Linux系统安装官方Docker教程

官方脚本安装(比较适合国外机器)

curl -fsSL https://get.docker.com/ | sh
systemctl start docker # 启动Docker
systemctl status docker # 查看Docker状态
systemctl enable docker # 开机启动Docker

官方脚本安装(适合国内机器)

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

如果提示:curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to get.docker.com:443 

说明需要安装证书即可,我这里以Debian10 为例

apt-get -y install apt-transport-https ca-certificates curl software-properties-common

如果是Centos服务器(未做测试)

# step 1: 安装必要的一些系统工具
yum install -y yum-utils device-mapper-persistent-data lvm2
# Step 2: 添加软件源信息
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

常用方法

docker stop $(docker ps -a -q) //  stop停止所有容器 
docker rm $(docker ps -a -q) //   remove删除所有容器

# 删除未使用的镜像
docker image prune

# 删除未使用的网络
docker network prune

注:这些只是我解决的办法,如果有问题可以留言,文章不定时完善更新


News article is edited by: Caesar - 2024-03-26, 10:44

文章作者: Caesar
文章链接: https://pcnto.com/daily-learning/31-linux-installation-docker-tutorial.html
版权声明: 本博客所有文章除特别声明外,转载请注明来自 Peng blog

如果您喜欢本站,你可以点击主页广告以示支持,谢谢。

广告是本站收益的来源希望您能够谅解。