繁体   English   中英

nginx:在 $PATH 中找不到可执行文件”:未知

[英]nginx : executable file not found in $PATH": unknown

我正在尝试使用 Redhat UBI 映像部署 Nginx 映像,因为我构建了可以无错误编译的映像。 我在 $PATH 中找不到错误可执行文件”:未知。

谁能告诉我我的 dockerfile 中缺少什么?

我正在使用 RedHat UBI 开放图像中的图像,使用已提供的容器图像。

https://catalog.redhat.com/software/containers/search?q=ubi

下面是我正在使用的 Dockerfile。

FROM registry.access.redhat.com/ubi8/ubi-init
USER root
COPY api-gatway /usr/share/nginx/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]

以下是我在尝试运行 docker 镜像后得到的错误

docker run --name testinxcg -d -p 8080:80 test
6220f7274745212afbab07e20bbbf9fa4995a834962b104d7951b6d4965a3237
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"nginx\": executable file not found in $PATH": unknown.
uk-c02xk2ykjg5j:api-gateway mbyousaf$ 

Red Hat Enterprise Linux (RHEL) 8 中没有 docker,但有一个 OCI 兼容的替代品,称为 Podman 和 Buildah。

为了在不需要守护程序的情况下启用容器管理,红帽为您的 Linux 容器应用程序开发引入了一组工具:Buildah 允许您构建一个没有任何守护程序或 docker 的容器。 Podman 允许您在没有守护程序依赖项的情况下管理容器,它还与 docker cli 兼容。

# podman pull

RHEL 8 compatible images can be found [here][2].

# yum install -y podman

# alias docker=podman

type to use podman in place of docker - for using docker commands

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM