diff --git a/server/Dockerfile b/server/Dockerfile index a7c96480..c1c292f7 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -21,15 +21,30 @@ RUN apt-get update -qq && \ apt-get install --no-install-recommends -y build-essential autoconf automake libtool git libpq-dev libvips pkg-config m4 perl libltdl-dev curl git wget unzip default-libmysqlclient-dev COPY getduckdb.sh . -# Make the script executable -RUN chmod +x getduckdb.sh +COPY getduckdbcli.sh . + +# Make the scripts executable +RUN chmod +x getduckdb.sh getduckdbcli.sh + +# Run the scripts RUN ./getduckdb.sh +RUN ./getduckdbcli.sh +# Unzip and move DuckDB files RUN unzip duckdb.zip -d libduckdb RUN mv libduckdb/duckdb.* /usr/local/include RUN mv libduckdb/libduckdb.so /usr/local/lib RUN ldconfig /usr/local/lib +# Download and install the DuckDB CLI +RUN unzip duckdb_cli.zip -d duckdb_cli +RUN mv duckdb_cli/duckdb /usr/local/bin/ +RUN chmod +x /usr/local/bin/duckdb + +RUN ldconfig /usr/local/lib +# Load the httpfs extension into DuckDB +RUN echo "INSTALL httpfs; LOAD httpfs;" | duckdb + # # Navigate to the directory of the component you want to build WORKDIR / diff --git a/server/Dockerfile.dev b/server/Dockerfile.dev index 394bcc03..e16a9127 100644 --- a/server/Dockerfile.dev +++ b/server/Dockerfile.dev @@ -10,15 +10,27 @@ RUN apt-get update -qq && \ apt-get install --no-install-recommends -y build-essential autoconf automake libtool git libpq-dev libvips pkg-config m4 perl libltdl-dev curl git wget unzip default-libmysqlclient-dev COPY getduckdb.sh . +COPY getduckdbcli.sh . + # Make the script executable -RUN chmod +x getduckdb.sh +RUN chmod +x getduckdb.sh getduckdbcli.sh + RUN ./getduckdb.sh +RUN ./getduckdbcli.sh +# Unzip and move DuckDB files RUN unzip duckdb.zip -d libduckdb RUN mv libduckdb/duckdb.* /usr/local/include RUN mv libduckdb/libduckdb.so /usr/local/lib -RUN ldconfig /usr/local/lib +# Download and install the DuckDB CLI +RUN unzip duckdb_cli.zip -d duckdb_cli +RUN mv duckdb_cli/duckdb /usr/local/bin/ +RUN chmod +x /usr/local/bin/duckdb + +RUN ldconfig /usr/local/lib +# Load the httpfs extension into DuckDB +RUN echo "INSTALL httpfs; LOAD httpfs;" | duckdb WORKDIR /rails diff --git a/server/getduckdbcli.sh b/server/getduckdbcli.sh new file mode 100644 index 00000000..f5231efc --- /dev/null +++ b/server/getduckdbcli.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +MACHINE=`uname -m` + +case "$MACHINE" in + "x86_64" ) ARC=amd64 ;; + "aarch64" ) ARC=aarch64 ;; +esac + +wget -O duckdb_cli.zip "https://github.com/duckdb/duckdb/releases/download/v1.0.0/duckdb_cli-linux-$ARC.zip" \ No newline at end of file