Skip to main content

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 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 for visual project configuration
  • Build images with SSH support (currently only Ubuntu-based images are supported)
  • 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

For details, please refer to the Documentation

(back to top)

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)

Start the web interface for visual project configuration:

# 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

The web interface provides:

  • Visual project configuration with organized tabs
  • Real-time validation and error checking
  • Project import/export functionality
  • Interactive help and tooltips

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

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pei_docker-1.0.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pei_docker-1.0.0-py3-none-any.whl (272.9 kB view details)

Uploaded Python 3

File details

Details for the file pei_docker-1.0.0.tar.gz.

File metadata

  • Download URL: pei_docker-1.0.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

Hashes for pei_docker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4b420de04ba94ebba1e7d9c6272c30006c18c784ec47d30c98a491b045cd03f9
MD5 8b87c44fd0426300be52057bc4281107
BLAKE2b-256 c5d48f13691e3aee315375dd19f9019e4e7392d9c7e7b8bca43ce46d03db1bf5

See more details on using hashes here.

File details

Details for the file pei_docker-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pei_docker-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 272.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for pei_docker-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7993a2cb8bdbab690dbe497edcd78edb76d03f87c3e1c35f6ff302d896f93c06
MD5 286fb409173505f9ddb09199c31e81ac
BLAKE2b-256 2887f18bfa5988d06063dd7f905fdab9092595c97c89963e035a52575983fc69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page