【问题标题】:Fedora Container No 'find' Command Available [closed]Fedora 容器没有可用的“查找”命令 [关闭]
【发布时间】:2020-02-06 11:07:34
【问题描述】:

我已经构建了一个容器:

> cat Dockerfile
FROM fedora:latest

USER root

RUN dnf update -y && \
    dnf clean all && \
    dnf autoremove

> docker build -t dev .
> docker run -t -d <container_id>
> docker exec -it <container_id> /bin/bash
$ dnf install -y which
$ which find
which: no find in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)

到目前为止,我使用过的每个 Linux 发行版都预装了 find,所以我不完全确定在这里做什么。

快速的 Google 搜索会产生关于如何使用 find 的结果,或者为什么在 bash 脚本中使用它时找不到它等。但无论我使用的关键字是什么使用,我似乎找不到以前遇到过这种情况的人。

dnf search find 没有显示任何结果,但也许它使用了另一个名称?还是我必须自己编译?

【问题讨论】:

    标签: bash find containers fedora dnf


    【解决方案1】:
    # dnf whatprovides '*/bin/find'
    findutils-1:4.6.0-24.fc31.x86_64 : The GNU versions of find utilities (find and xargs)
    Repo        : @System
    Matched from:
    Filename    : /usr/bin/find
    
    findutils-1:4.6.0-24.fc31.x86_64 : The GNU versions of find utilities (find and xargs)
    Repo        : fedora
    Matched from:
    Filename    : /usr/bin/find
    
    # dnf install -y findutils
    

    【讨论】:

      猜你喜欢
      • 2016-05-18
      • 1970-01-01
      • 2016-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-11
      • 2022-11-28
      相关资源
      最近更新 更多