安装ubuntu docker完整版

本文介绍了如何使用简单命令安装Ubuntu Docker的完整版,并提供了制作完整版Docker镜像的详细步骤,包括脚本内容和对比其他方法的繁琐之处。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装ubuntu docker完整版

困扰了很久怎么安装ubuntu docker的完整版,后来发现从ssh登陆进docker镜像的时候有提示,可以用一条命令完美安装ubuntu的完整版。

命令

unminimize

执行效果

➜  ~ unminimize
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

This script restores content and packages that are found on a default
Ubuntu server system in order to make this system more suitable for
interactive use.

Reinstallation of packages may fail due to changes to the system
configuration, the presence of third-party packages, or for other
reasons.

This operation may take some time.

Would you like to continue? 

大功告成!

脚本内容

发现并不是每个ubuntu 版本都有这个脚本,所以把这个脚本贴出来了。

脚本位于 /usr/local/sbin/unminimize

具体内容如下:

#!/bin/sh

set -e

echo "This system has been minimized by removing packages and content that are"
echo "not required on a system that users do not log into."
echo ""
echo "This script restores content and packages that are found on a default"
echo "Ubuntu server system in order to make this system more suitable for"
echo "interactive use."
echo ""
echo "Reinstallation of packages may fail due to changes to the system"
echo "configuration, the presence of third-party packages, or for other"
echo 
### 虚拟机中安装Ubuntu并配置Docker #### 安装Ubuntu操作系统 为了在虚拟机上部署Ubuntu,需先创建一个新的虚拟机实例,并选择合适的ISO文件作为启动盘来完成操作系统的初步安装过程。按照向导提示逐步进行直到镜像安装完毕。 #### 配置基础环境 一旦Ubuntu系统已经成功安装,在终端执行如下命令以确保基本工具和服务处于最新状态以及正常运行: ```bash sudo apt install vim sudo apt install openssh-server sudo systemctl status ssh sudo systemctl start ssh sudo apt update && sudo apt upgrade -y ``` 上述指令用于安装vim编辑器和SSH服务端程序,并确认SSH服务的状态及其启动状况,最后更新软件包列表并将现有已安装的软件升级到最新版本[^1]。 #### 准备Docker仓库密钥 对于安全性和验证的需求,应通过`curl`获取官方发布的GPG公钥,并将其保存至指定路径下以便后续APT能够识别来自Docker官方资源库的安全性签名。 ```bash curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg ``` 这一步骤确保了从Docker官方网站下载的内容可以被正确校验其真实性与完整性[^2]。 #### 添加稳定版Docker APT源 为了让APT能访问Docker提供的二进制分发渠道,还需添加相应的APT源地址到系统配置当中去。具体做法是在/etc/apt/sources.list.d/目录内新建一个名为docker.list的文件,写入适合当前发行版的信息。 ```bash echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ``` 这条语句动态构建了一个适用于特定架构和Ubuntu代号(如focal、jammy等)的APT源定义字符串,并追加到了新建立的docker.list文件里。 #### 正式安装Docker CE 有了前面准备好的前提条件之后,现在可以通过标准的方式直接利用APT来进行Docker社区版(CE)的实际安装工作。 ```bash sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` 这里不仅包含了核心组件docker-ce本身,还额外集成了CLI客户端和其他辅助模块containerd.io及带有插件支持功能的新一代compose工具docker-compose-plugin。 #### 验证安装成果 当一切顺利完成后,可通过简单测试命令查看所安裝Docker的具体版本信息从而证明整个流程无误结束。 ```bash docker --version ``` 如果返回了预期中的版本号,则说明Docker已经在Ubuntu虚拟环境中成功就位。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

M2kar

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值