Oxen-AI/Oxen

Alpine based Docker image?

SamuelMarks opened this issue · 0 comments

Rough attempt:

FROM rust:alpine AS build

ENV OPENSSL_DIR=/usr
RUN apk --no-cache add ruby-dev ffmpeg-libavdevice ffmpeg-libavcodec libressl-dev dbus-libs clang-dev g++ git make cmake ninja
WORKDIR /usr/src/oxen
COPY . .
RUN cargo build --locked --release && \
    mv /usr/src/oxen/target/release/oxen /bin/ && \
    mv /usr/src/oxen/target/release/oxen-server /bin/

FROM alpine
COPY --from=build /bin/oxen /bin/
CMD ["/bin/oxen"]

Latest error:

889.7   cargo:warning=In file included from duckdb/ub_src_common.cpp:37:
889.7   cargo:warning=duckdb/src/common/local_file_system.cpp:43:10: fatal error: linux/falloc.h: No such file or directory
889.7   cargo:warning=   43 | #include <linux/falloc.h>
889.7   cargo:warning=      |          ^~~~~~~~~~~~~~~~
889.7   cargo:warning=compilation terminated.
889.7   exit status: 0
889.7   exit status: 0
889.7   exit status: 0
889.7   exit status: 0
889.7   exit status: 0
889.7   exit status: 0
889.7   exit status: 0
889.7   exit status: 1
889.7   cargo:warning=ToolExecError: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "duckdb" "-I" "duckdb/third_party/libpg_query" "-I" "duckdb/third_party/lz4" "-I" "duckdb/third_party/mbedtls" "-I" "duckdb/third_party/utf8proc" "-I" "duckdb/third_party/jaro_winkler/details" "-I" "duckdb/third_party/re2" "-I" "duckdb/third_party/fsst" "-I" "duckdb/third_party/mbedtls/library" "-I" "duckdb/third_party/fastpforlib" "-I" "duckdb/third_party/utf8proc/include" "-I" "duckdb/third_party/libpg_query/include" "-I" "duckdb/third_party/httplib" "-I" "duckdb/third_party/jaro_winkler" "-I" "duckdb/third_party/skiplist" "-I" "duckdb/third_party/fmt/include" "-I" "duckdb/third_party/fast_float" "-I" "duckdb/third_party/hyperloglog" "-I" "duckdb/third_party/miniz" "-I" "duckdb/src/include" "-I" "duckdb/third_party/mbedtls/include" "-I" "duckdb/third_party/concurrentqueue" "-I" "duckdb/third_party/pcg" "-I" "duckdb/third_party/tdigest" "-std=c++11" "-w" "-DDUCKDB_EXTENSION_AUTOINSTALL_DEFAULT=1" "-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1" "-o" "/usr/src/oxen/target/debug/build/libduckdb-sys-04cc29fd62744a5e/out/239a61d5cb207136-ub_src_common.o" "-c" "duckdb/ub_src_common.cpp" with args c++ did not execute successfully (status code exit status: 1).
889.7   error occurred: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "duckdb" "-I" "duckdb/third_party/libpg_query" "-I" "duckdb/third_party/lz4" "-I" "duckdb/third_party/mbedtls" "-I" "duckdb/third_party/utf8proc" "-I" "duckdb/third_party/jaro_winkler/details" "-I" "duckdb/third_party/re2" "-I" "duckdb/third_party/fsst" "-I" "duckdb/third_party/mbedtls/library" "-I" "duckdb/third_party/fastpforlib" "-I" "duckdb/third_party/utf8proc/include" "-I" "duckdb/third_party/libpg_query/include" "-I" "duckdb/third_party/httplib" "-I" "duckdb/third_party/jaro_winkler" "-I" "duckdb/third_party/skiplist" "-I" "duckdb/third_party/fmt/include" "-I" "duckdb/third_party/fast_float" "-I" "duckdb/third_party/hyperloglog" "-I" "duckdb/third_party/miniz" "-I" "duckdb/src/include" "-I" "duckdb/third_party/mbedtls/include" "-I" "duckdb/third_party/concurrentqueue" "-I" "duckdb/third_party/pcg" "-I" "duckdb/third_party/tdigest" "-std=c++11" "-w" "-DDUCKDB_EXTENSION_AUTOINSTALL_DEFAULT=1" "-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1" "-o" "/usr/src/oxen/target/debug/build/libduckdb-sys-04cc29fd62744a5e/out/239a61d5cb207136-ub_src_common.o" "-c" "duckdb/ub_src_common.cpp" with args c++ did not execute successfully (status code exit status: 1).
889.7 
889.

Been messing around with different builds at my https://github.com/SamuelMarks/oxen-builds and https://hub.docker.com/r/samuelmarks/oxen-builds

Best I've gotten so far is this:

FROM gcr.io/distroless/cc-debian12
WORKDIR /bin
# Extract oxen-server from your 'oxen-server-ubuntu-latest.deb'
ADD oxen-server .
ENTRYPOINT ["/bin/oxen-server", "--version"]

Which gives me:
121MB local
40MB compressed


Update: After some proper troubleshooting on the Alpine side; looks like the blocker is probably duckdb/duckdb-rs#336


EDIT3: Consolidated all my comments on this GitHub issue to just this first post.

I now also trigger a release everytime you have a release:
https://github.com/SamuelMarks/oxen-builds/tree/master/.github/workflows

And the latest Dockerfiles you can find in that repository also. Still would be great to get an Alpine build working!