Add DuckDB to the Docker build and the Gem
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -14,10 +14,25 @@ FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
|
||||
# Rails app lives here
|
||||
WORKDIR /rails
|
||||
|
||||
# Install base packages
|
||||
# Install base packages and DuckDB library
|
||||
ARG TARGETPLATFORM
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 && \
|
||||
apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 wget unzip && \
|
||||
ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so && \
|
||||
case "$TARGETPLATFORM" in \
|
||||
"linux/amd64") \
|
||||
DUCKDB_ARCH="amd64" ;; \
|
||||
"linux/arm64") \
|
||||
DUCKDB_ARCH="arm64" ;; \
|
||||
*) \
|
||||
echo "Unsupported platform: $TARGETPLATFORM" && exit 1 ;; \
|
||||
esac && \
|
||||
wget "https://install.duckdb.org/v1.4.2/libduckdb-linux-${DUCKDB_ARCH}.zip" -O /tmp/libduckdb.zip && \
|
||||
unzip /tmp/libduckdb.zip -d /tmp/duckdb && \
|
||||
cp /tmp/duckdb/duckdb.h /tmp/duckdb/duckdb.hpp /usr/local/include/ && \
|
||||
cp /tmp/duckdb/libduckdb.so /usr/local/lib/ && \
|
||||
ldconfig && \
|
||||
rm -rf /tmp/libduckdb.zip /tmp/duckdb && \
|
||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
||||
|
||||
# Set production environment variables and enable jemalloc for reduced memory usage and latency.
|
||||
|
||||
Reference in New Issue
Block a user