-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alpine Dockerfile with Lua #292
Conversation
Better wording
g3proxy/docker/lua.alpine.Dockerfile
Outdated
ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig | ||
RUN cargo build --profile release-lto \ | ||
--no-default-features --features quic,c-ares,hickory,lua54 \ | ||
-p g3proxy -p g3proxy-ctl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may also want to compile in g3proxy-lua, which can be used to verify the call result of the script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append -p g3proxy-lua to line 18?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay you got it, I'll add that tonight after testing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the bit of code but it doesn't work.
Inside the container, after rebuilding and running:
ls /usr/bin/g3proxy
g3proxy g3proxy-ctl
There's no g3proxy-lua binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COPY is also needed in the final build step.
Is it possible to use dynamic linking? I see nginx-mod-http-lua is available in alpine, which seems to be dynamic linked. |
|
I'll look into this a bit more tonight. I forgot to note this is my first time using Lua. Also, I don't have a compiled language background - so I don't think I can be of much help in regards to static/dynamic linking. Actually, I'll have to move away from Lua to Python because Lua doesn't have first-party Google Cloud support (no SDKs). After I do that, I'll contribute the Python Dockerfile as well. |
you can support both lua and python features in the same docker file. It has to be dynamic linked to be able to call c based lua/python libs I guess. |
I looked into the comment you posted, which led me to learn a bit about musl, and frankly I've no idea about all this dynamic and static linking. I can't even conceptualize it, really.. It's ok. I'll add Python, and if you wanna take it further, that's great. |
I will switch the default alpine build to use dynamic first, then you can sync the changes to this script-enabled docker build file. |
6f21d54 updated to use dynamic linking |
I added the missing COPY g3proxy-lua |
Done both, error is during build, during
|
It seems that package |
It builds, but here's what happens next.
|
You need to install the missing dynamic libs before COPY. |
Got it, I'll be pushing that tonight after testing. |
runs after 736e36d as per your comment |
# beware: lua's c modules (e.g. cjson) | ||
# need to be statically linked | ||
# and won't work when installing in | ||
# alpine via luarocks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is no longer valid. fixing.
For running Lua auth in containers.
Makes installing Lua modules easy via
luarocks
.