A lightweight and up-to-date Docker image for the Telegram Database Library (TDLib)
1.5K
A lightweight and up-to-date Docker image for the Telegram Database Library (TDLib).
Compiling TDLib from source can be incredibly resource-intensive (often requiring lots of RAM and taking a long time). This repository automates the build process via GitHub Actions, providing you with ready-to-use, pre-compiled TDLib binaries inside a Docker container.
You can pull the latest built image directly from Docker Hub (or GitHub Container Registry, depending on your setup):
docker pull airani/tdlib:latest
You can use this image as a base for your own Telegram bots or clients.
FROM airani/tdlib:latest
# Set your working directory
WORKDIR /app
# Copy your bot code
COPY . .
# Run your application (Example for a Python wrapper)
CMD ["python3", "main.py"]
If you only need the compiled .so (shared object) files to keep your final image minimal, use a multi-stage build to copy the binaries into your preferred runtime environment:
# Stage 1: Get TDLib from the pre-built image
FROM airani/tdlib:latest AS tdlib
# Stage 2: Your actual application environment (e.g., Python, Node.js)
FROM python:3.10-slim
# Copy the compiled TDLib binary from the first stage
# (Adjust the source path depending on where it is built in the Dockerfile)
COPY --from=tdlib /usr/local/lib/libtdjson.so /usr/local/lib/libtdjson.so
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python3", "bot.py"]
If you want to build the Docker image yourself on your local machine:
git clone https://github.com/airani/tdlib.git
cd tdlib
docker build -t airani/tdlib:local .
(Note: Ensure your Docker daemon has access to at least 4GB to 8GB of RAM, as g++ compilation for TDLib is highly memory-intensive.)
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Distributed under the MIT License. See LICENSE for more information. Note that TDLib itself is licensed under the Boost Software License.
Maintained by airani
Content type
Image
Digest
sha256:b9c263323…
Size
175.3 MB
Last updated
8 months ago
docker pull airani/tdlib