Ubuntu Server 安装 Docker

Ubuntu Server 安装 Docker

Ubuntu Server 版本 20.04.2

一、安装Docker

1. 使用官方安装脚本自动安装

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

curl -sSL https://get.daocloud.io/docker | sh

出现问题可再试几次

出现下面提示安装成功

docker version // 查看 Docker 版本

出现 permission denied 情况在命令前加上 sudo,下同

image

2. 运行 Hello World

sudo docker ps // 查看镜像(当前为空)

拉取 hello-world 镜像

docker pull hello-world

image

运行 hello-world

docker run hello-world

image

成功运行

--THE END--

posted @ 2021-04-15 22:32  ysj101  阅读(233)  评论(0)    收藏  举报