docker-entrypoint exec nginx 未找到
Posted
技术标签:
【中文标题】docker-entrypoint exec nginx 未找到【英文标题】:docker-entrypoint exec nginx not found 【发布时间】:2021-02-02 12:57:00 【问题描述】:我不确定我所做的是否正确,如果我弄错了,请纠正我。
这是我的 dockerfile:
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
是什么?我该如何解决?
【问题讨论】:
【参考方案1】:已经有一个安装了rtmp模块的nginx镜像:
docker pull tiangolo/nginx-rtmp
使用方法:
https://hub.docker.com/r/tiangolo/nginx-rtmp/
现在解决你的问题,如果你去官方的 nginx docker 镜像仓库 https://github.com/nginxinc/docker-nginx,第 38 行是:
exec "$@"
那有什么作用呢?
更多信息在这里:
https://unix.stackexchange.com/questions/466999/what-does-exec-do
【讨论】:
以上是关于docker-entrypoint exec nginx 未找到的主要内容,如果未能解决你的问题,请参考以下文章