feat(lua-client): 新增 Lua 客户端 SDK 及 demo,修复 Dockerfile 构建问题

This commit is contained in:
2026-07-22 21:06:38 +08:00
parent 295de72308
commit accfb229af
3 changed files with 51 additions and 5 deletions
+14 -4
View File
@@ -1,10 +1,14 @@
# Build stage
FROM lua:5.4 AS build
FROM alpine:3.20 AS build
WORKDIR /src
# Install build dependencies
RUN apk add --no-cache git
# Install Lua and dependencies
RUN apk add --no-cache lua5.4 lua5.4-dev luarocks5.4 git build-base
# Create symlinks
RUN ln -sf /usr/bin/lua5.4 /usr/bin/lua && \
ln -sf /usr/bin/luarocks-5.4 /usr/bin/luarocks
# Copy client library
COPY kenaito-conf-lua-client/ ./kenaito-conf-lua-client/
@@ -19,10 +23,16 @@ WORKDIR /src
COPY kenaito-conf-lua-client-demo/ ./kenaito-conf-lua-client-demo/
# Runtime stage
FROM lua:5.4
FROM alpine:3.20
WORKDIR /app
# Install Lua runtime
RUN apk add --no-cache lua5.4
# Create symlink
RUN ln -sf /usr/bin/lua5.4 /usr/bin/lua
# Copy Lua modules from build stage
COPY --from=build /usr/local/share/lua/5.4 /usr/local/share/lua/5.4
COPY --from=build /usr/local/lib/lua/5.4 /usr/local/lib/lua/5.4
+1 -1
View File
@@ -86,7 +86,7 @@ docker run -it --rm \
kenaito-conf-perl-demo
```
## Lua 客户端
## Lua 客户端(测试通过)
```bash
docker build -f Dockerfile.lua -t kenaito-conf-lua-demo .
@@ -0,0 +1,36 @@
package = "kenaito-conf"
version = "1.0.3-1"
source = {
url = "git://github.com/odboy/kenaito-conf.git",
tag = "v1.0.3",
dir = "kenaito-conf-lua-client"
}
description = {
summary = "Kenaito Config Center Lua Client",
detailed = [[
Lua client SDK for Kenaito Config Center.
Supports config fetching, caching, and change notification.
]],
homepage = "https://github.com/odboy/kenaito-conf",
license = "Apache-2.0",
maintainer = "odboy <tianjun@odboy.cn>"
}
dependencies = {
"lua >= 5.1",
"luasocket",
"dkjson"
}
build = {
type = "builtin",
modules = {
["kenaito_conf"] = "kenaito_conf/init.lua",
["kenaito_conf.client"] = "kenaito_conf/client.lua",
["kenaito_conf.config"] = "kenaito_conf/config.lua",
["kenaito_conf.cache"] = "kenaito_conf/cache.lua",
["kenaito_conf.listener"] = "kenaito_conf/listener.lua"
}
}