Skip to content
Skills Library
DevOps & cloud · Tool integration

pei-docker-usage

/pei-docker-usage

Helper for PeiDocker (`pei-docker-cli`). Trigger ONLY when the user explicitly requests PeiDocker usage OR when working within a PeiDocker-generated project (indicated by `user_config.yml`).

Licence
MIT
Last repository change
11.05.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
8
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 11.05.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Helper for PeiDocker (`pei-docker-cli`). Trigger ONLY when the user explicitly requests PeiDocker usage OR when working within a PeiDocker-generated project (indicated by `user_config.yml`).

Original author description

Helper for PeiDocker (`pei-docker-cli`). Trigger ONLY when the user explicitly requests PeiDocker usage OR when working within a PeiDocker-generated project (indicated by `user_config.yml`).

How it works

  1. Overview
  2. Execution Strategy
  3. Workflow
  4. Common Tasks
  5. References
Original SKILL.md headings · 129 lines, 519 words
SKILL.md preview
---
name: pei-docker-usage
description: Helper for PeiDocker (`pei-docker-cli`). Trigger ONLY when the user explicitly requests PeiDocker usage OR when working within a PeiDocker-generated project (indicated by `user_config.yml`).
---

# PeiDocker Usage

## Overview

PeiDocker (`pei-docker-cli`) is a tool that automates the creation of Docker environments. Instead of writing complex `Dockerfile`s and `docker-compose.yml` files, you define your environment in a high-level YAML file (`user_config.yml`). PeiDocker then generates the necessary Docker configuration.

**Official Repository:** [https://github.com/igamenovoer/PeiDocker](https://github.com/igamenovoer/PeiDocker)

**Key Features:**
*   **Two-Stage Builds:** Separates system setup (`stage-1`) from application/dev setup (`stage-2`).
*   **Built-in SSH:** easy configuration of SSH access to containers.
*   **Dynamic Storage:** Seamlessly switch between host-mounted volumes (dev) and Docker volumes (deployment).
*   **Proxy Support:** Configure proxies for build and run time.

## Execution Strategy

When invoking `pei-docker-cli`, follow this priority order:

1.  **Project-Local (Pixi):** If working in a Pixi-managed project (check for `pyproject.toml` or `pixi.toml` with `pei-docker` dependency), use:
    ```bash
    pixi run pei-docker-cli ...
    ```
2.  **Global (uv):** Check for global installation:
    ```bash
    uv tool run pei-docker-cli ...
    ```
3.  **Fallback:** If neither is found, suggest installation:
    *   **In Pixi project:** `pixi add pei-docker`
    *   **Global usage:** `uv tool install pei-docker`

## Workflow

The standard workflow for using PeiDocker is:

### 1. Create a Project

Initialize a new PeiDocker project in a target directory.

```bash
pixi run pei-docker-cli create -p path/to/project_dir
```

This creates the directory structure and a template `user_config.yml`.

### 2. Configure (`user_config.yml`)

Edit the `user_config.yml` in the project directory to define your environment.

**Key Sections:**
*   `stage_1`: Base image settings (OS, system packages).
    *   `image`: Base image (e.g., `ubuntu:24.04`) and output tag.
    *   `ssh`: Enable SSH, set ports and users.
    *   `apt`: Configure apt mirrors (e.g., `tuna`, `aliyun`).
*   `stage_2`: Application/Developer settings.
    *   `storage`: Define where `/app`, `/data`, and `/workspace` map to (host paths or auto-volumes).
    *   `custom`: Scripts to run on build, first run, or login.

See [basic-examples.md](references/basic-examples.md) and [advanced-examples.md](references/advanced-examples.md) for detailed configuration examples.

### 3. Generate Docker Files

After editing `user_config.yml`, generate the `docker-compose.yml` and `Dockerfile`s.

```bash
# From within the project directory
cd path/to/project_dir
pixi run pei-docker-cli configure

# Or specifying the path
pixi run pei-docker-cli configure -p path/to/project_dir
```

### 4. Build and Run

Use standard `docker compose` commands to build and start the containers.

```bash
cd path/to/project_dir

# Build the images (progress=plain shows build logs)
docker compose build stage-1 --progress=plain
docker compose build stage-2 --progress=plain

# Run the container (usually stage-2 for development)
docker compose up -d stage-2
```

## Common Tasks

### Adding Custom Scripts

PeiDocker allows running scripts at various lifecycle stages. Scripts should be placed in `container-scripts/` (to run inside container) or `host-scripts/` (to run on host).

In `user_config.yml`:
```yaml
stage_2:
  custom:
    on_build:
      - 'stage-2/custom/install-my-app.sh'
    on_first_run:
      - 'stage-2/custom/setup-env.sh'
```

### Configuring SSH

To enable SSH access:

```yaml
stage_1:
  ssh:
    enable: true
    port: 22          # Container internal port
    host_port: 2222   # Host mapped port
    users:
      developer:
        password: 'password123'
        pubkey_file: '~' # Use current user's public key
```

## References

*   **[guidelines.md](references/guidelines.md)**: Best practices for project structure, data safety, and customization.
*   **[user-config-reference.md](references/user-config-reference.md)**: Full reference for `user_config.yml` options.
*   **[installation-scripts.md](references/installation-scripts.md)**: Usage guide for system installation scripts (Pixi, uv, Node.js, Bun).
*   **[user_config.yml](templates/user_config.yml)**: Template for a full `user_config.yml` file.
*   **[basic-examples.md](references/basic-examples.md)**: Basic configurations (SSH, GPU, Volumes).
*   **[advanced-examples.md](references/advanced-examples.md)**: Advanced scenarios (Env Vars, OpenGL, Complex Apps).
*   **[cli-reference.md](references/cli-reference.md)**: Detailed CLI command reference.
Files in this package (8)
  • SKILL.md 5 KB
  • references/advanced-examples.md 3 KB
  • references/basic-examples.md 15 KB
  • references/cli-reference.md 4 KB
  • references/guidelines.md 6 KB
  • references/installation-scripts.md 4 KB
  • references/user-config-reference.md 4 KB
  • templates/user_config.yml 13 KB

Versions

The database has no other skills named pei-docker-usage.

Database snapshot: 13.11.2026 · package version 8b9c6aa66851 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100pe-tax-credits
    Use this skill for Prince Edward Island provincial tax credits — PEI Low-Income Tax Reduction, PEI Sales Tax Credit, PEI Volunteer Firefighter / Ground Search and Rescue Tax Credit, Teacher School Supply Amount (PEI), PEI Equity Tax Credit (35%), PEI Innovation and Development…
  • 90pe-individual-return
    Use this skill whenever asked about Prince Edward Island provincial individual income tax. Trigger on phrases like \"PEI tax\", \"Prince Edward Island tax\", \"PE provincial tax\", \"PEI T1\", \"PEI brackets\", \"HST PEI\", \"PEI surtax\", \"PEI credits\", or any question about…
  • 100solohost-package
    Build a SoloHost package — the docker-compose.yml + config_options.yml pair SoloHost needs to install an app from an already-published public Docker image onto someone's computer. Use this whenever the user wants to publish, package, ship, or list an app on SoloHost or Pi…
  • 100docker-expert
    Use when working with Dockerfile, docker-compose.yml, .dockerignore, or multi-stage builds. Build, debug, secure, and optimize Docker 27+ images and Docker Compose services.
  • 100docker-patterns
    Provides Docker and Docker Compose patterns including multi-stage builds, networking, volumes, and production configurations. Use when working with Dockerfile or docker-compose.yml, or when the user mentions Docker, containers, or containerization.
  • 96docker
    Docker开发专家助手。当用户需要进行Docker镜像构建、容器编排、Dockerfile编写、Docker Compose或容器化部署时调用。

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.