Description
The current Dockerfile fails when building an image for use with SQLite. Users are encountering two main errors:
- A missing shared library:
database-replicator: error while loading shared libraries: libsqlite3.so.0: cannot open shared object file: No such file or directory
- A GLIBC version mismatch:
database-replicator: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.39' not found (required by database-replicator)
This prevents users from running the database-replicator with SQLite inside a Docker container, causing significant friction.
Root Cause
The debian:bookworm-slim base image used in the Dockerfile lacks the necessary libsqlite3-0 package. Furthermore, the database-replicator binary appears to be compiled with a newer version of GLIBC than is available in the bookworm-slim distribution.
Proposed Solution
To resolve this, the Dockerfile should be updated to:
- Use a more recent base image, such as
ubuntu:24.04, which includes a compatible GLIBC version.
- Explicitly install the
libsqlite3-0 package.
Here is the updated Dockerfile:
# syntax=docker/dockerfile:1
FROM ubuntu:24.04 AS downloader
ARG VERSION=latest
ENV BINARY_NAME=database-replicator-linux-x64-binary
ENV RELEASE_ROOT=https://github.com/serenorg/database-replicator/releases
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && rm -rf /var/lib/apt/lists/*
RUN set -eux; \
if [ "$VERSION" = "latest" ]; then \
URL="$RELEASE_ROOT/latest/download/$BINARY_NAME"; \
else \
URL="$RELEASE_ROOT/download/$VERSION/$BINARY_NAME"; \
fi; \
curl -fL "$URL" -o /tmp/database-replicator && \
chmod +x /tmp/database-replicator
FROM ubuntu:24.04
LABEL org.opencontainers.image.title="database-replicator" \
org.opencontainers.image.description="Seren database replicator CLI" \
org.opencontainers.image.source="https://github.com/serenorg/database-replicator"
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates libsqlite3-0 libssl3 libpq5 postgresql-client && \
rm -rf /var/lib/apt/lists/* && \
useradd -m replicator
COPY --from=downloader /tmp/database-replicator /usr/local/bin/database-replicator
USER replicator
ENTRYPOINT ["database-replicator"]
CMD ["--help"]
Description
The current
Dockerfilefails when building an image for use with SQLite. Users are encountering two main errors:database-replicator: error while loading shared libraries: libsqlite3.so.0: cannot open shared object file: No such file or directorydatabase-replicator: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.39' not found (required by database-replicator)This prevents users from running the
database-replicatorwith SQLite inside a Docker container, causing significant friction.Root Cause
The
debian:bookworm-slimbase image used in theDockerfilelacks the necessarylibsqlite3-0package. Furthermore, thedatabase-replicatorbinary appears to be compiled with a newer version of GLIBC than is available in thebookworm-slimdistribution.Proposed Solution
To resolve this, the
Dockerfileshould be updated to:ubuntu:24.04, which includes a compatible GLIBC version.libsqlite3-0package.Here is the updated
Dockerfile: