linux - docker-entrypoint exec nginx 未找到
问题描述
我不确定我在做什么是正确的,如果我弄错了,请纠正我。
这是我的码头文件:
FROM nginx:latest
RUN apt update && apt install build-essential libpcre3 libpcre3-dev libssl-dev libnginx-mod-rtmp -y
我正在尝试添加rtmp module
到我的 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/
现在对于您的问题,如果您转到 https://github.com/nginxinc/docker-nginx中的官方 nginx docker 映像存储库,第 38 行是:
exec "$@"
那有什么作用呢?
更多信息在这里:
https://unix.stackexchange.com/questions/466999/what-does-exec-do
推荐阅读
- macos - Macos 中的隐蔽日期模式抛出日期:不存在的时间
- python - 如果下载按钮没有 URL,如何从网站下载 CSV 文件?
- dynamic - 通过 elementor 向 wordpress RSS 提要添加动态功能
- javascript - 相同 HTML 上的 2 个 D3.js 条形图。一个 D3 脚本破坏了另一个
- json - 使用 hazelcast jet 处理 JSON
- powershell - 如何在经典devop(不是yaml)中设置变量并在不同任务之间传递?
- javascript - 从子页面设置母版页中包含的 HiddenField 的值
- bash - 将文件中的内容复制/粘贴到多个 tmux ssh 会话中
- javascript - 如何在 2018 年之前的 FastReport 版本中将 html 新行转换为 FastReport.frx 新行?
- amazon-web-services - 在超级账本结构对等方和订购方上进行 TLS 握手时出现错误