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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dockercor-0.1.3.tar.gz
(4.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dockercor-0.1.3.tar.gz.
File metadata
- Download URL: dockercor-0.1.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.7 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fed48ab8d4a0d7f753ec4820dea38d110390699f24350f630e7411517eaa33b2
|
|
| MD5 |
b510e31c0e5102591d1b44e42a8642ce
|
|
| BLAKE2b-256 |
f55ff0b94db2b588f2c96618f04b2d1732d6f3b754b242fc06f1b59a23236afa
|
File details
Details for the file dockercor-0.1.3-py3-none-any.whl.
File metadata
- Download URL: dockercor-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.7 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a5e81da8751f8d33b05b7188879f5368cd211bbca4ad2fdebf3678b511118d7
|
|
| MD5 |
2c1f15042b9d804f618c1f44d492939a
|
|
| BLAKE2b-256 |
f26aacce4a9f7e76078b32629e5cc87296ed184f4959c91c4ec8cdea967bc824
|