A pythonic toolkit for composing, managing, and deploying Docker images and containers.
Project description
Pythainer
Pythainer is an open-source Python package designed to facilitate the creation, management, composition and deployment of Docker containers for various use cases, with a focus on ease of use and automation.
Features
- Docker Image Building: Simplify Docker image construction with pre-defined Python scripts.
- Project Examples: Includes examples for building, installing, and running applications within Docker containers.
- Extensible: Easily extendable to include more features or adapt existing ones to different environments or requirements.
Getting Started
Prerequisites
- Python 3.10 or later
- Docker
Installation
To get started with Pythainer, clone this repository and set up a virtual environment:
git clone https://github.com/apaolillo/pythainer.git
cd pythainer
./scripts/install_venv.sh
Usage
Here is a simple example of how to use Pythainer to build a Docker container:
from pythainer.examples.builders import get_user_builder
from pythainer.runners import ConcreteDockerRunner
image_name = "pythainertest"
builder = get_user_builder(image_name=image_name, base_ubuntu_image="ubuntu:22.04")
builder.root()
builder.add_packages(packages=["vim", "git", "tmux"])
builder.user("${USER_NAME}")
runner = ConcreteDockerRunner(image=image_name)
builder.build()
runner.run()
High-level source organization
The source code of this repository is organized as follows:
pythainer
├── pythainer Core package containing all the essential modules for the framework.
│ ├── builders Modules responsible for building Docker images through automated scripts.
│ │ ├── cmds.py Defines command classes that translate high-level actions into Dockerfile commands.
│ │ └── utils.py Provides utility functions supporting Docker image construction.
│ ├── examples Contains various examples demonstrating the use of Pythainer components.
│ │ ├── builders Examples showcasing how to use the builders module to create Docker images.
│ │ ├── installs Examples demonstrating how to handle software installations inside Docker containers.
│ │ └── runners Examples illustrating how to execute and manage Docker containers for specific tasks.
│ ├── runners Contains utilities for running Docker containers.
│ └── sysutils.py Provides system utilities such as shell command execution and directory management.
└── scripts Directory containing scripts that facilitate development and operational tasks.
Contributing
Contributions to Pythainer are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
Please read CONTRIBUTING.md for details on the process.
Roadmap
Check out the ROADMAP.md file to see the plans for future releases.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Maintainers
For major changes and guidance, the list of active maintainers is available in the MAINTAINERS file.
Support
For support, raise an issue in the GitHub issue tracker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pythainer-0.0.4.tar.gz
.
File metadata
- Download URL: pythainer-0.0.4.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4430b10213f1bc07a32ae92d7ec8ae8dedf14f1e5a04b87c9014fd3d697d1478 |
|
MD5 | daf7e99148b2fee206786d25a4348770 |
|
BLAKE2b-256 | 6853f62a973908e70f3e6523635a3d1a76dd4bcd5c99408e7ffedfae601f7297 |
File details
Details for the file pythainer-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: pythainer-0.0.4-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0465a32db95821295b6c023f900f62b691e744202560cc5aba006666ec948bbf |
|
MD5 | a8c2d1ee042a8d08f127151b5ca52e37 |
|
BLAKE2b-256 | cfa530cd91f14dd5c68c5e4aec934f8934b3c37f9c4eefde7dd8980c2969269c |