我用以下方法构建了一个容器:
> 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
没有显示结果,但也许是另一个名称?还是我必须自己编译?
# 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