linux - 找不到 docker-entrypoint exec nginx

标签 linux docker nginx dockerfile rtmp

我不确定我在做什么是正确的,所以如果我弄错了请纠正我。

这是我的 dockerfile:

FROM nginx:latest

RUN apt update && apt install build-essential libpcre3 libpcre3-dev libssl-dev libnginx-mod-rtmp -y 

我正在尝试将 rtmp 模块 添加到我的 nginx。

我正在尝试使用以下命令运行图像:

docker run --rm --name mynginx -p 80:80 -v ~/nginx/conf/nginx.conf:/etc/nginx/nginx.conf mynginx:latest

这是我收到的:

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
/docker-entrypoint.sh: 38: exec: nginx: not found

那是什么/docker-entrypoint.sh: 38: exec: nginx: not found?我该如何解决?

最佳答案

已经有安装了rtmp模块的nginx镜像:

docker pull tiangolo/nginx-rtmp

使用方法:

https://hub.docker.com/r/tiangolo/nginx-rtmp/

现在针对你的问题,如果你去官方的nginx docker image repository https://github.com/nginxinc/docker-nginx , 第 38 行是:

exec "$@"

那有什么用呢?

更多信息在这里:

https://unix.stackexchange.com/questions/466999/what-does-exec-do

关于linux - 找不到 docker-entrypoint exec nginx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66010212/

相关文章:

linux - Unix命令操作

python - uwsgi: OSError: GET 请求期间写入错误

linux - 用top判断Linux进程内存

nginx - 设置入口(Kubernetes)

linux - 在日志文件中捕获 nethogs 输出

linux - 自定义 ebtables 模块 && skb 操作 && 内核 panic

linux - Bash:检查脚本是否已经在此计算机上运行

mongodb - 如何在容器重启之间持久化 MongoDB 数据?

node.js - 将带有Docker的MERN应用程序部署到GCP App Engine时发生问题-部署是否需要花费几个小时?

django - Docker - Django 设置 - Gunicorn ok 但不是 manage.py