Production
INFO
LakeSail offers flexible enterprise support options, including managing Sail on Kubernetes.
Get in touch to learn more.
Building the Sail Docker image from source is recommended for production deployments where performance is critical.
In an empty directory, create a Dockerfile
with the following content.
docker
ARG RELEASE_TAG
ARG RUST_VERSION=1.82.0
ARG RUST_PROFILE=release
ARG RUSTFLAGS="-C target-cpu=native"
ARG PYSPARK_VERSION=3.5.1
FROM python:3.11-slim AS builder
ARG RELEASE_TAG
ARG RUST_VERSION
ARG RUST_PROFILE
ARG RUSTFLAGS
ENV RUSTFLAGS="${RUSTFLAGS}"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
gcc \
libc6-dev \
protobuf-compiler \
libprotobuf-dev \
curl \
git
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup-init && \
chmod a+x /tmp/rustup-init && \
/tmp/rustup-init -y --no-modify-path --profile minimal --default-toolchain ${RUST_VERSION}
ENV PATH="/root/.cargo/bin:${PATH}"
WORKDIR /app
RUN git clone --depth 1 --branch "${RELEASE_TAG}" https://github.com/lakehq/sail.git .
RUN --mount=type=cache,target=/root/.cargo/registry/ \
--mount=type=cache,target=/root/.cargo/git/ \
--mount=type=cache,target=/app/target/ \
RUST_TARGET_SUBDIR=$(case "${RUST_PROFILE}" in \
dev|test) echo "debug" ;; \
release|prod|bench) echo "release" ;; \
*) echo "${RUST_PROFILE}" ;; \
esac) && \
cargo build -p sail-cli --profile ${RUST_PROFILE} --bins && \
cp /app/target/${RUST_TARGET_SUBDIR}/sail /usr/local/bin
FROM python:3.11-slim
ARG PYSPARK_VERSION
RUN python3 -m pip install --no-cache-dir "pyspark[connect]==${PYSPARK_VERSION}"
COPY --from=builder /usr/local/bin/sail /usr/local/bin
ENTRYPOINT ["/usr/local/bin/sail"]
In the same directory, run the following command with the desired release tag or branch name to build the Docker image.
bash
docker build -t sail:latest --build-arg RELEASE_TAG="v0.2.0.dev0" .
INFO
The release build may take some time to complete.