Sign inSign up

openeuler/distroless-pip-cc

Sponsored OSS

By openeuler

•Updated about 1 month ago

Image
0

2.1K

openeuler/distroless-pip-cc repository overview

⁠Quick reference

⁠distroless-pip-cc | openEuler

This image provides a minimal python pip runtime with libstdc++ support.

Key Components:

  • Python pip runtime
  • libstdc++ (GLIBC implementation)

Use Cases:

  • Python apps with C/C++ extensions (e.g. NumPy/Pandas)
  • Python apps calling C/C++ shared libraries

The tag details are as follows

TagCurrentlyArchitectures
23.3.1-cc12.3.1-oe2403lts⁠PIP 23.3.1 and libstdc++ 12.3.1 on openEuler 24.03-LTSamd64, arm64

⁠Usage

Dockerfile Example (Python pip with libstdc++ Dependencies)

# Base image with minimal Python pip runtime and libstdc++
FROM openeuler/distroless-pip-cc:23.3.1-cc12.3.1-oe2403lts

# Update CA certificates for SSL verification
RUN update-ca-trust

# Install Python packages with libstdc++ dependencies, pyarrow requires libstdc++ runtime
RUN pip install pyarrow pandas

COPY app.py /app/

CMD ["python3", "/app/app.py"]

app.py (PyArrow Data Processing Example)

import pyarrow as pa
import pyarrow.parquet as pq
import pandas as pd
from datetime import datetime

def process_data():
    """Demonstrates PyArrow's core features with Arrow Tables and Parquet I/O"""
    
    data = {
        "timestamp": [datetime(2023, 1, 1), datetime(2023, 1, 2)],
        "temperature": [22.5, 23.1],
        "sensor_id": ["A001", "A002"]
    }
    table = pa.Table.from_pydict(data)
    
    df = table.to_pandas()
    print("Pandas DataFrame:")
    print(df)
    
    pq.write_table(table, "/app/data.parquet", compression='SNAPPY')
    reloaded = pq.read_table("/app/data.parquet")
    
    mean_temp = pa.compute.mean(reloaded["temperature"])
    print(f"\nMean temperature: {mean_temp.as_py():.2f}°C")

if __name__ == "__main__":
    print(f"PyArrow version: {pa.__version__}")
    print(f"Running with {pa.cpu_count()} CPU cores")
    process_data()

⁠Run Applications as a Non-Root User

For implementation details, refer to the distroless-base-nonroot documentation⁠.

⁠Question and answering

If you have any questions or want to use some special features, please submit an issue or a pull request on openeuler-docker-images⁠.

Tag summary

Content type

Image

Digest

sha256:86b4c536f…

Size

28.6 MB

Last updated

about 1 month ago

docker pull openeuler/distroless-pip-cc:23.3.1-cc12.3.1-oe2403lts

This week's pulls

Pulls:

15

Last week