Docker 安装 Ubuntu 教程

2023-07-0910:46:09服务器及运维Comments983 views字数 392阅读模式

Ubuntu 是基于 Debian 的 Linux 操作系统。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

1、查看可用的 Ubuntu 版本

访问 Ubuntu 镜像库地址: https://hub.docker.com/_/ubuntu?tab=tags&page=1文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

可以通过 Sort by 查看其他版本的 Ubuntu。默认是最新版本 ubuntu:latest 。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

Docker 安装 Ubuntu 教程文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

你也可以在下拉列表中找到其他你想要的版本:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

Docker 安装 Ubuntu 教程文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

2、拉取最新版的 Ubuntu 镜像

$ docker pull ubuntu

或者:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

$ docker pull ubuntu:latest

Docker 安装 Ubuntu 教程文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

3、查看本地镜像

$ docker images

Docker 安装 Ubuntu 教程文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

在上图中可以看到我们已经安装了最新版本的 ubuntu。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

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

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

Docker 安装 Ubuntu 教程文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

Docker 安装 Ubuntu 教程文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

5、安装成功

最后我们可以通过 docker ps 命令查看容器的运行信息:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

Docker 安装 Ubuntu 教程文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50815.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/yunwei/50815.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定