Skip to content

Dockerfile fails to build for SQLite due to missing libraries and GLIBC mismatch #63

@taariq

Description

@taariq

Description

The current Dockerfile fails when building an image for use with SQLite. Users are encountering two main errors:

  1. A missing shared library: database-replicator: error while loading shared libraries: libsqlite3.so.0: cannot open shared object file: No such file or directory
  2. 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:

  1. Use a more recent base image, such as ubuntu:24.04, which includes a compatible GLIBC version.
  2. 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"]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions