A sophisticated Docker automation framework that transforms YAML configurations into reproducible containerized environments
Project description
PeiDocker (配 docker)
Easily automate docker building process without learning much about Dockerfiles.
About The Project
You don't have time to learn Dockerfiles, we get it.
But don't keep your docker images around, they will be messed up eventually. If you ever want to make reproducible docker images but have no patience to learn Dockerfiles and docker-compose, PeiDocker is for you.
PeiDocker (配 docker) helps you script and organize your docker image building process with both CLI and modern Web GUI interfaces. It streamlines the building process and allows you to customize the image building and running behaviours using shell scripts.
With PeiDocker, you can:
- Use the intuitive Web GUI with visual configuration wizard, real-time validation, and auto-port selection
- Native desktop mode for OS-native window experience (optional, requires pywebview)
- Build images with SSH support including multiple authentication methods (password, public/private keys)
- Configure separate port mappings for system services (stage-1) and applications (stage-2)
- Install packages from public repository mirrors, or via proxy
- Install apps for your container, during or after building, into places such as docker volumes, bind mounts or in-image directory
- Run custom commands during image building, when the container starts, or when you SSH into the container
- Use environment variables with fallback values in configuration files for flexible deployments across different environments
- Export/import projects as ZIP files for easy sharing and backup
- Advanced template system with minimal config mode for quick setups
For details, please refer to the Documentation
Getting Started
Installation
Option 1: Install from PyPI (Recommended)
pip install pei-docker
Option 2: Install from Source
git clone https://github.com/igamenovoer/PeiDocker.git
cd PeiDocker
pip install -e .
Prerequisites
- Docker and docker-compose installed on your machine
- Python 3.11 or higher
Usage
Web GUI (Recommended for beginners)
The modern web interface provides an intuitive way to manage PeiDocker projects:
# Start GUI on auto-selected port
pei-docker-gui start
# Or specify a custom port
pei-docker-gui start --port 8080
# Load an existing project
pei-docker-gui start --project-dir /path/to/my/project
# Jump directly to specific configuration page
pei-docker-gui start --jump-to-page ssh
# Run in native desktop mode (requires pywebview)
pei-docker-gui start --native
Key Features:
- Visual Configuration Wizard: Step-by-step interface with organized tabs for all settings
- Real-time Validation: Instant feedback on configuration errors and warnings
- Auto-port Selection: Automatically finds available ports if default is in use
- Multiple SSH Auth Methods: Support for password, public key files, inline keys, and private keys
- Project Import/Export: Download/upload projects as ZIP files for easy sharing
- Jump-to-Page: Quick navigation to specific configuration sections for debugging
- Minimal Config Mode: Streamlined templates for quick project setup
- Native Desktop Mode: Optional OS-native window experience (when pywebview is installed)
- Interactive Help: Contextual tooltips and documentation links throughout the interface
Available Pages:
home- Welcome page with project managementproject- Basic project settings and Docker image configurationssh- SSH server and user authentication setupnetwork- Port mappings and proxy configurationenvironment- Environment variables with Docker Compose-style substitutionstorage- Volume and bind mount configurationscripts- Custom script management for build and runtimesummary- Complete project overview with export functionality
Command Line Interface
Create a new project:
# Create a new project in ./build or any other directory
pei-docker-cli create -p ./build
# Optional: Create without examples or contrib files
pei-docker-cli create -p ./build --no-with-examples --no-with-contrib
Edit the configuration file user_config.yml in the project directory (e.g.,./build) according to your needs. Generate the docker-compose.yml file in the project directory:
# From within the project directory
cd ./build
pei-docker-cli configure
# Or specify project directory explicitly
pei-docker-cli configure -p ./build
# Optional: Use a different config file
pei-docker-cli configure -p ./build -c my-custom-config.yml
# Optional: Generate full compose file with extended sections
pei-docker-cli configure -p ./build -f
Build the docker images. There are two images to be built, namely stage-1 and stage-2. stage-1 is intended to be a base image, installing system apps using apt install, stage-2 is intended to be a final image based on stage-1, installing custom apps using downloaded packages like .deb. External storage is only available in stage-2.
cd ./build
# Using docker compose to build the images.
# To see all the output, use --progress=plain
# To cleanly rebuild the images, use --no-cache
# Build the stage-1 image
# By default, the image is named pei-image:stage-1, you can change it in user_config.yml
docker compose build stage-1 --progress=plain
# Build the stage-2 image
# By default, the image is named pei-image:stage-2
docker compose build stage-2 --progress=plain
Run the docker container:
# inside project directory, such as ./build
# Typically you will run the stage-2 container
# You can also up the stage-1 container as well.
docker compose up stage-2
If you have setup SSH in user_config.yml, now you can SSH into the container:
# by default, it will create a user named `me` with password '123456'
# and map the port 2222 to the container's port 22
ssh me@127.0.0.1 -p 2222
That's it, you are good to go.
For more examples, please refer to the Documentation
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
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 pei_docker-1.1.0.tar.gz.
File metadata
- Download URL: pei_docker-1.1.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f46abf66bb9aa1685099cd1deac565c1ff4e83bf3840d03f6257ce495bb687c6
|
|
| MD5 |
d44b11ea8fc3ecc8869aaeaabc251879
|
|
| BLAKE2b-256 |
47d1c7c48a31f2584fd9594981e06641da6091f07268a8a5e901ccdb4b2f290b
|
File details
Details for the file pei_docker-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pei_docker-1.1.0-py3-none-any.whl
- Upload date:
- Size: 268.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e37704ce8979a055ac80f0c75fe75348c2a4ac27b39e41f4d147af720667d892
|
|
| MD5 |
f9b9b020c64c07741fea86addab3e91e
|
|
| BLAKE2b-256 |
950444f666e97c0950b8b7e7b904b5a7047e8c6105fa31c826ca819916ee5b4d
|