我有一个 docker 镜像 nginx:stable-alpine,我需要使用 nginx-extras
为了使用 rewrite_by_lua
指示。
我尝试通过 apk add --cached
安装它但没有任何工作。
这是我的 docker 文件:
FROM nginx:stable-alpine
RUN apk add nginx-extras
这是 docker 构建日志:
Building nginx
Step 1/2 : FROM nginx:stable-alpine
---> acc350649a48
Step 2/2 : RUN apk add nginx-extras
---> Running in 857246deaaf7
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
nginx-extras (missing):
required by: world[nginx-extras]
任何帮助将不胜感激。
最佳答案
您必须使用以下 Dockerfile
:
FROM alpine
RUN apk add --no-cache nginx-mod-http-lua-upstream
CMD ["nginx", "-g", "daemon off;"]
关于docker - 添加rewrite_by_lua模块到nginx :alpine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56331880/