问题描述
我正在使用基于以下内容的docker映像 firesh/nginx-lua 在高山上.
I am using a docker image firesh/nginx-lua which based on alpine.
我按如下所示安装软件包管理器行李箱:
I install the package-manager luarocks as follows:
/bin/luarocks-3.5.0 # apk update
fetch http://mirrors.aliyun.com/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://mirrors.aliyun.com/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
v3.8.5-66-gccbd6a8ae7 [http://mirrors.aliyun.com/alpine/v3.8/main]
v3.8.5-66-gccbd6a8ae7 [http://mirrors.aliyun.com/alpine/v3.8/community]
OK: 9564 distinct packages available
/bin/luarocks-3.5.0 # apk add luarocks
OK: 53 MiB in 38 packages
/bin/luarocks-3.5.0 # luarocks
sh: luarocks: not found
您可以看到已经安装了羽绒服,但是当我尝试使用它时却找不到.
As you can see luarocks was installed, but it is not found when I try to use it.
关于如何在此docker上安装luarocks的任何建议?
Any suggestions of how should I install luarocks on this docker?
推荐答案
我认为此图像不适合您要执行的操作.这是启用了LUA(用于nginx)的NginX.该图像不包含任何 lua
开发环境.要用于if lua,请先安装lua
I think this image is not the right thing for what you want to do. This is NginX with LUA (for nginx) enabled. The image doesn't contain any lua
development environment. To use if for lua, install lua first
docker run -ti --rm --name test firesh/nginx-lua sh / # apk update
fetch http://mirrors.aliyun.com/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://mirrors.aliyun.com/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
v3.8.5-66-gccbd6a8ae7 [http://mirrors.aliyun.com/alpine/v3.8/main]
v3.8.5-66-gccbd6a8ae7 [http://mirrors.aliyun.com/alpine/v3.8/community]
OK: 9564 distinct packages available
/ # apk add lua-dev
(1/4) Installing lua5.1-libs (5.1.5-r7)
(2/4) Installing lua5.1 (5.1.5-r7)
(3/4) Installing pkgconf (1.5.3-r0)
(4/4) Installing lua5.1-dev (5.1.5-r7)
Executing busybox-1.28.4-r3.trigger
OK: 52 MiB in 36 packages
/ # apk add luarocks
(1/7) Installing ca-certificates (20191127-r2)
(2/7) Installing nghttp2-libs (1.39.2-r0)
(3/7) Installing libssh2 (1.9.0-r1)
(4/7) Installing libcurl (7.61.1-r3)
(5/7) Installing curl (7.61.1-r3)
(6/7) Installing luarocks (2.4.4-r0)
(7/7) Installing luarocks5.1 (2.4.4-r0)
Executing busybox-1.28.4-r3.trigger
Executing ca-certificates-20191127-r2.trigger
OK: 54 MiB in 43 packages
/ # luarocks
sh: luarocks: not found
/ # luarocks-
luarocks-5.1 luarocks-admin-5.1
/ # luarocks-5.1 --version
/usr/bin/luarocks-5.1 2.4.4
LuaRocks main command-line interface
在此之后,您将具有 luarocks-5.1
作为命令.如果要在没有 -5.1
的情况下使用它,请使用
after this you will have luarocks-5.1
as a command. If you want to use it without the -5.1
use
/ # alias luarocks=luarocks-5.1
/ # luarocks
Warning: The directory '/root/.cache/luarocks' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing /usr/bin/luarocks-5.1 with sudo, you may want sudo's -H flag.
LuaRocks 2.4.4, the Lua package manager
...
...
这篇关于apk安装了一个软件包,但未找到(在Docker上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!