2

In a docker container based on debian:bullseye-slim I need to manually add the lua package lua-resty-openidc, as github or luarocks is blocked by the company proxy.

Currently I try to install the apiclient in the Docker Container with

RUN set luarocks make apiclient-2.6.0-2.rockspec

This is what I get on our company build server:

luarocks make apiclient-2.6.0-2.rockspec
Missing dependencies for apiclient 2.6.0-2:
   lua-resty-openidc ~> 1.7.6 (not installed)

apiclient 2.6.0-2 depends on lua ~> 5.1 (5.1-1 provided by VM)
apiclient 2.6.0-2 depends on lua-resty-openidc ~> 1.7.6 (not installed)
Warning: Failed searching manifest: Failed downloading https://luarocks.org/manifest-5.1 - failed downloading https://luarocks.org/manifest-5.1
...
Error: Could not satisfy dependency lua-resty-openidc ~> 1.7.6: No results matching query were found for Lua 5.1.

Locally on my MacBook I can build the Docker Container, as it is not as restricted as the build server. So on the Docker Container that I built successfully locally, I tried to:

  1. Find all the files for lua-resty-openidc with grep -rl openidc /
$ grep -rl openidc /
...
/usr/local/share/lua/5.1/kong/plugins/apiclient/access.lua
/usr/local/share/lua/5.1/resty/openidc.lua
/usr/local/share/lua/5.1/resty/openidc.lua~
/usr/local/lib/luarocks/rocks-5.1/manifest
/usr/local/lib/luarocks/rocks-5.1/lua-resty-openidc/1.7.6-3/doc/RELEASE.md
/usr/local/lib/luarocks/rocks-5.1/lua-resty-openidc/1.7.6-3/doc/README.md
/usr/local/lib/luarocks/rocks-5.1/lua-resty-openidc/1.7.6-3/rock_manifest
/usr/local/lib/luarocks/rocks-5.1/lua-resty-openidc/1.7.6-3/lua-resty-openidc-1.7.6-3.rockspec
/usr/local/lib/luarocks/rocks-5.1/lua-resty-jwt/0.2.3-0/doc/README.md
/usr/local/lib/luarocks/rocks-5.1/apiclient/2.6.0-2/apiclient-2.6.0-2.rockspec
  1. Copy them out
docker cp locally-built-container:/usr/local/share/lua/5.1/resty/openidc.lua plugins/
docker cp locally-built-container:/usr/local/lib/luarocks/rocks-5.1/lua-resty-openidc plugins/
  1. Copy them into the Docker Container at build:
COPY ./plugins/openidc.lua /usr/local/share/lua/5.1/resty/openidc.lua
COPY ./plugins/lua-resty-openidc /usr/local/lib/luarocks/rocks-5.1/
...
RUN luarocks make apiclient-2.6.0-2.rockspec

However when building the Docker Container on the Build Server, lua still tries to download lua-resty-openidc over the internet.

How can I completely manually install lua-resty-openidc - which files are still needed?

Or can I fool luarocks somehow to use a local cache /root/.cache/luarocks? Which files are needed for the cache?

ESkri
  • 1,461
  • 1
  • 1
  • 8
mles
  • 4,534
  • 10
  • 54
  • 94

0 Answers0