apk 安装了一个包,但没有找到(在 Docker 上) [英] apk installed a package but its not found (on Docker)

查看:32
本文介绍了apk 安装了一个包,但没有找到(在 Docker 上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用基于 docker 镜像 firesh/nginx-lua在高山上.

I am using a docker image firesh/nginx-lua which based on alpine.

我安装包管理器 luarocks 如下:

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

如您所见,luarocks 已安装,但我尝试使用时未找到.

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 for 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 上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆