Install With Docker
Build and run Lavik 0.1.0-beta.1 with persistent container storage.
Before You Start
Run native Linux/amd64 or Linux/arm64 with a Linux 6.1+ kernel and io_uring enabled. Docker Desktop uses its Linux VM; allocate at least 2 CPUs and 2 GiB to that VM for this example. Do not use x86 emulation on an ARM Mac for the io_uring runtime. These examples build a local image from the Minimal beta.1 release, using kernel TCP and io_uring.
The example reserves a 512 MiB data file and caps retained memory at 512 MiB. Choose capacity for your workload before the first start; never truncate an existing data file. The named volume holds both data and logs. Removing that volume deletes the database. Keep backups outside the volume.
Host ports bind to 127.0.0.1. This local evaluation has no password; do not expose it publicly. seccomp:unconfined permits io_uring where Docker’s default profile blocks it, and relaxes syscall filtering. The container still runs as a non-root user, drops capabilities and prevents privilege escalation. For shared or production hosts, use a reviewed io_uring-capable seccomp policy and configure authentication/TLS before allowing remote clients.
Create The Image Files
Create a new working directory. Save the following two files as Dockerfile and start.sh. The build selects your native architecture and checks the release archive against its SHA-256 checksum. It is a locally built image, not an assumed public Lavik image tag.
Dockerfile
FROM ubuntu:24.04@sha256:b3cc40b72b93588182b5410f723c7aaf142363311c2aa993d8a453ddcbb3ae15
ARG TARGETARCH
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl libnuma1 libuuid1 redis-tools \
&& rm -rf /var/lib/apt/lists/*
RUN set -eu; \
case "$TARGETARCH" in \
arm64) arch=aarch64; checksum=819df5f9f6c534f0fa988d1a9ec3531f1e6b0651527591a54e7235688bf8d984 ;; \
amd64) arch=x86_64; checksum=8a3e66f313e7112a3a9dff7b1a0d67ae34e988dfa51f5c310e860d0b3f2daa77 ;; \
*) echo 'Use native linux/amd64 or linux/arm64' >&2; exit 1 ;; \
esac; \
curl -fL "https://github.com/eloqdata/lavik/releases/download/v0.1.0-beta.1/lavik-v0.1.0-beta.1-linux-${arch}-minimal.tar.gz" -o /tmp/lavik.tar.gz; \
echo "$checksum /tmp/lavik.tar.gz" | sha256sum -c -; \
mkdir /opt/lavik; tar -xzf /tmp/lavik.tar.gz --strip-components=1 -C /opt/lavik; \
rm /tmp/lavik.tar.gz; chmod -R a+rX /opt/lavik; \
install -d -o 65532 -g 65532 /var/lib/lavik
COPY start.sh /usr/local/bin/start-lavik
RUN chmod 755 /usr/local/bin/start-lavik
USER 65532:65532
EXPOSE 6379 9100
ENTRYPOINT ["/usr/local/bin/start-lavik"]start.sh
#!/bin/sh
set -eu
# A named volume keeps this data file across container replacement.
# Allocate only on the first start; never truncate existing data.
if [ ! -e /var/lib/lavik/data ]; then
fallocate -l 512M /var/lib/lavik/data
fi
exec /opt/lavik/lavik --bind 0.0.0.0 --port 6379 --metrics-port 9100 \
--network kernel --storage uring --threads 2 --no-pin-workers \
--registered-buffer-mb-per-worker 64 --max-memory 512MiB \
--shutdown-checkpoint --data-file /var/lib/lavik/data \
--log-dir /var/lib/lavik/logs "$@"Build And Start
Run these commands in the directory containing the two files. The names lavik-beta1 and lavik-beta1-data must not belong to another installation. The first PING may run before startup completes: check docker logs and retry until it returns PONG before issuing SET and GET. Expected replies are PONG, OK and hello from Lavik.
docker-run.sh
docker build -t lavik-local:0.1.0-beta.1 .
docker run -d --name lavik-beta1 \
-p 127.0.0.1:6379:6379 -p 127.0.0.1:9100:9100 \
--mount source=lavik-beta1-data,target=/var/lib/lavik \
--ulimit memlock=536870912:536870912 \
--memory 1g --cpus 2 --read-only --tmpfs /tmp \
--cap-drop ALL --security-opt no-new-privileges:true \
--security-opt seccomp:unconfined --stop-timeout 60 \
lavik-local:0.1.0-beta.1
docker logs lavik-beta1
docker exec lavik-beta1 redis-cli PING
docker exec lavik-beta1 redis-cli SET greeting 'hello from Lavik'
docker exec lavik-beta1 redis-cli GET greetingLogs, Metrics And Restart
Use docker logs lavik-beta1 for startup diagnostics. Metrics are available at http://127.0.0.1:9100/metrics. Use docker stop --time 60 lavik-beta1, then docker start lavik-beta1 to restart without replacing the data volume. After startup, GET greeting should return the saved value. To remove only the container, stop it first and use docker rm lavik-beta1; keep lavik-beta1-data and reuse it on the next docker run.