g3/g3proxy/docker/lua.alpine.Dockerfile
Nino 67421a39cd
Some checks failed
Linux-CI / Clippy (push) Has been cancelled
CrossCompiling / Build (push) Has been cancelled
CodeCoverage / g3bench test (push) Has been cancelled
CodeCoverage / g3statsd test (push) Has been cancelled
CodeCoverage / lib unit test (push) Has been cancelled
CodeCoverage / g3mkcert test (push) Has been cancelled
CodeCoverage / g3keymess test (push) Has been cancelled
CodeCoverage / g3proxy test (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (java-kotlin) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
CodeQL Advanced / Analyze (rust) (push) Has been cancelled
Linux-CI / Build (push) Has been cancelled
Linux-CI / Build vendored (push) Has been cancelled
Linux-CI / Build with OpenSSL Async Job (push) Has been cancelled
MacOS-CI / Build (push) Has been cancelled
MacOS-CI / Build vendored (push) Has been cancelled
StaticLinking / musl (push) Has been cancelled
StaticLinking / msvc (push) Has been cancelled
Windows-CI / Build (push) Has been cancelled
Windows-CI / Build vendored (push) Has been cancelled
Fixes #901 g3proxy: lua alpine dockerfile not building (#921)
* fixed the now-invalid comment about luarocks

* Fixes g3proxy: lua alpine dockerfile not building at https://github.com/bytedance/g3/issues/901

* Fixed lua dockerfile

* Fixed lua dockerfile - removed unnecessary code
2025-09-07 04:10:32 +00:00

26 lines
No EOL
1.1 KiB
Docker

FROM nickblah/lua:5.4-luarocks-alpine3.22 AS lua
RUN apk add --no-cache build-base
RUN luarocks install lua-cjson
FROM rust:alpine3.22 AS builder
WORKDIR /usr/src/g3
COPY . .
RUN apk add --no-cache musl-dev cmake capnproto-dev openssl-dev c-ares-dev lua5.4-dev pkgconfig
ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig
ENV RUSTFLAGS="-Ctarget-feature=-crt-static"
RUN cargo build --profile release-lto \
--no-default-features --features rustls-ring,quic,c-ares,lua54 \
-p g3proxy -p g3proxy-ctl -p g3proxy-lua
FROM alpine:3.22
RUN apk add --no-cache ca-certificates libgcc c-ares lua5.4-libs
COPY --from=lua /usr/local/bin/lua /usr/local/bin/
COPY --from=lua /usr/local/bin/luarocks /usr/local/bin/
COPY --from=lua /usr/local/lib/lua /usr/local/lib/
COPY --from=lua /usr/local/share/lua /usr/local/share/
COPY --from=lua /usr/local/lib/luarocks /usr/local/lib/luarocks
COPY --from=builder /usr/src/g3/target/release-lto/g3proxy /usr/bin/
COPY --from=builder /usr/src/g3/target/release-lto/g3proxy-ctl /usr/bin/
COPY --from=builder /usr/src/g3/target/release-lto/g3proxy-lua /usr/bin/
ENTRYPOINT ["/usr/bin/g3proxy"]
CMD ["-Vvv"]