DockerCor
A lightweight Python package for managing Docker images and running containers with ease.
Features
- Simple Docker image management
- Easy container command execution
- Docker image information retrieval
- Command-line interface using Typer
- Python API for script integration
Installation
You can install DockerCor using pip:
pip install dockercor
Or using Poetry:
poetry add dockercor
Usage
Command Line Interface
# Ensure a Docker image is available locally
dockercor ensure-image ubuntu:latest
# Force update an image
dockercor ensure-image ubuntu:latest --force
# Run a command in a container
dockercor run ubuntu:latest echo "Hello from container"
# Get information about an image
dockercor info ubuntu:latest
Python API
from dockercor import ensure_docker_image, run_docker_command, get_image_info
# Ensure image is available
updated, message = ensure_docker_image("ubuntu:latest")
print(message)
# Run a command in container
run_docker_command(["echo", "Hello from container"], "ubuntu:latest")
# Get image information
image_info = get_image_info("ubuntu:latest")
if image_info:
print(f"Image ID: {image_info['id']}")
print(f"Size: {image_info['size']}")
Development
This project uses Poetry for dependency management. To set up the development environment:
- Clone the repository:
git clone https://github.com/infocornouaille/dockercor.git
cd dockercor
- Install dependencies:
poetry install
- Run tests:
poetry run pytest
Requirements
- Python 3.12 or higher
- Docker installed and running on your system
- Poetry (for development)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for dockercor 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dockercor-0.1.3.tar.gz | 4.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dockercor-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / dockercor-0.1.3.tar.gz
| Download URL | dockercor-0.1.3.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fed48ab8d4a0d7f753ec4820dea38d110390699f24350f630e7411517eaa33b2
|
|
BLAKE2b-256 checksum How to use checksums |
f55ff0b94db2b588f2c96618f04b2d1732d6f3b754b242fc06f1b59a23236afa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.7 Darwin/24.1.0
|
Release files / dockercor-0.1.3-py3-none-any.whl
| Download URL | dockercor-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a5e81da8751f8d33b05b7188879f5368cd211bbca4ad2fdebf3678b511118d7
|
|
BLAKE2b-256 checksum How to use checksums |
f26aacce4a9f7e76078b32629e5cc87296ed184f4959c91c4ec8cdea967bc824
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.7 Darwin/24.1.0
|
Security for dockercor 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.