Sign inSign up

gabriellhl/rust-python

By gabriellhl

Updated 8 months ago

Image
0

201

gabriellhl/rust-python repository overview

Rust + Python Toolchain Image

Overview

This Docker image provides a reusable Rust + CPython toolchain designed for projects that combine:

  • Rust crates
  • Python bindings via PyO3
  • maturin-based build workflows

It is a base image, not an application image, and should be extended using FROM in service-specific Dockerfiles.


Included Components

ComponentVersion
Rust1.91
Python3.13.5 (built from source)
OS BaseDebian slim
Python toolspip, maturin, pytest

Why Python Is Built From Source

Python is compiled from source to:

  • Ensure correct PyO3 header/runtime matching
  • Enable ABI3 forward compatibility
  • Avoid distro-specific Python limitations
  • Provide deterministic, portable builds

Build flags used:

  • --enable-optimizations
  • --with-lto
  • --enable-shared

Environment Defaults

The image sets:

PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
RUST_BACKTRACE=1
PYTHONUNBUFFERED=1

Tag summary

Content type

Image

Digest

sha256:8676bc552

Size

500 MB

Last updated

8 months ago

docker pull gabriellhl/rust-python