我正在尝试使用 VirtualBox 从 .ova 开始,并希望稍后在 vSphere 中导入相同的映像。
Ubuntu 云映像不再有标准密码。
我想编辑 .ova 以配置密码。(以及后来的 SSH 密钥)
下载的 .ova 确实有密码属性。
我找到了一个名为cot(Common OVF tool)的工具来编辑属性。
我试过:
cot edit-properties ubuntu-18.04-server-cloudimg-amd64-custom.ova -p password=ubuntu
Run Code Online (Sandbox Code Playgroud)
也试过:
cot edit-properties ubuntu-18.04-server-cloudimg-amd64-custom.ova -p user-data="password: ubuntu"
Run Code Online (Sandbox Code Playgroud)
两次尝试都没有成功。(无法登入)
是否有一个步骤可以将此配置应用到图像中,或者这些属性是否在图像启动时传递给图像?
有任何想法吗?
更新:(背景问题的答案)
我正在尝试创建一个精简的 Centos 7.4 图像。我想删除我不需要的东西,并想保留 Python 和 Yum。首先,我想摆脱 systemd。
我正在建立我的形象:
sudo docker build --squash --compress -t smaller-centos smaller-centos
Run Code Online (Sandbox Code Playgroud)
Dockerfile:
FROM centos
RUN rpm -e --nodeps systemd
RUN yum remove -y dracut-033-502.el7_4.1.x86_64 iputils-20160308-10.el7.x86_64 device-mapper-1.02.140-8.el7.x86_64 dbus-1.6.12-17.el7.x86_64 kpartx-0.4.9-111.el7_4.2.x86_64 cryptsetup-libs-1.7.4-3.el7_4.1.x86_64 kpartx-0.4.9-111.el7_4.2.x86_64 acl-2.2.51-12.el7.x86_64 bind-license-9.9.4-51.el7_4.2.noarch cryptsetup-libs-1.7.4-3.el7_4.1.x86_64dbus-1.6.12-17.el7.x86_64 dbus-python-1.1.1-9.el7.x86_64 hostname-3.13-3.el7.x86_64 iputils-20160308-10.el7.x86_64 kmod-libs-20-15.el7_4.7.x86_64 passwd-0.79-4.el7.x86_64 python-gobject-base-3.22.0-1.el7_4.1.x86_64 qrencode-libs-3.4.1-3.el7.x86_64 rootfiles-8.1-11.el7.noarch vim-minimal-7.4.160-2.el7.x86_64
RUN yum clean all
CMD ["/bin/bash"]
Run Code Online (Sandbox Code Playgroud)
我删除了一些图像,但新图像仍然比原始图像大。
$ 须藤泊坞窗图像
smaller-centos latest 59c3425f7909 2 minutes ago 219MB
centos latest e934aafc2206 4 weeks ago 199MB
Run Code Online (Sandbox Code Playgroud)
$ sudo docker 版本
Client:
Version: 18.03.1-ce
API version: …Run Code Online (Sandbox Code Playgroud)