参考:https://www.runoob.com/docker/docker-install-ubuntu.html

访问 Ubuntu 镜像库地址: https://hub.docker.com/_/ubuntu?tab=tags&page=1

可以通过 Sort by 查看其他版本的 Ubuntu。默认是最新版本 ubuntu:latest 。

安装其他版本,例如:

docker pull ubuntu:18.04

拉取最新的Ubuntu镜像 :

$ docker pull ubuntu

或者

$ docker pull ubuntu:latest

查看本地镜像:

$ docker images

运行容器,并且可以通过 exec 命令进入 ubuntu 容器

$ docker run -itd --name ubuntu-test ubuntu

安装成功

可以使用docker ps 进行查看