在Ubuntu上獲取Docker鏡像主要有以下幾種方法:
docker pull命令,如docker pull ubuntu:latest可拉取最新版Ubuntu鏡像,也可指定版本號,如docker pull ubuntu:20.04。/etc/docker/daemon.json文件,添加國內鏡像源,如{"registry-mirrors": ["https://mirrors.ustc.edu.cn"]},然后重啟Docker服務sudo systemctl restart docker,之后再使用docker pull命令拉取鏡像。docker build -t 鏡像名 .命令來構建鏡像。docker load -i 鏡像文件.tar命令加載鏡像,如docker load -i ubuntu_20.04.tar。