【问题标题】:How can I run some cut commands in centos container?如何在 centos 容器中运行一些剪切命令?
【发布时间】:2021-12-11 10:23:11
【问题描述】:

我使用 docker 运行 CentOS8 容器。

我知道图像被最小化了,所以我不能在其中使用一些命令。 如:clearsystemctl

[root@e07da148cc16 /]# clear
bash: clear: command not found

有没有办法安装一些模块,所以我可以运行它?或者是否还有其他未最小化的 CentOS 映像以及所有命令?

【问题讨论】:

    标签: docker centos


    【解决方案1】:

    docker run -it amazonlinux bash

    附带基本命令,供您进一步自定义(yum install)。

    【讨论】:

    • servicesystemctl 怎么样,我检查了没有这种类型的命令。
    • 你不会在 docker 中运行(虽然技术上可行)systemd(需要 pid 1)。您在容器中运行单个程序,不需要 systemd 来协调/管理容器内的守护程序服务。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-03-19
    • 2020-05-21
    • 2017-07-27
    • 1970-01-01
    • 1970-01-01
    • 2021-11-05
    • 1970-01-01
    相关资源
    最近更新 更多