01 Minimal SSHΒΆ
Use this when you want the smallest practical default two-stage Compose project: Ubuntu, one SSH user, and a final stage-2 image that inherits from stage-1.
Source: examples/basic/minimal-ssh/user_config.yml
stage_1:
image:
base: ubuntu:24.04
output: pei-example-minimal-ssh:stage-1
ssh:
enable: true
port: 22
host_port: 2222
users:
dev:
password: "123456"
stage_2:
image:
output: pei-example-minimal-ssh:stage-2
What it shows:
- the minimum required
imagedefinitions - SSH configured in stage-1
- stage-2 inheriting the stage-1 output image automatically in the default two-stage Compose workflow
Workflow:
pei-docker-cli create -p demo --quick minimal- Replace
demo/user_config.ymlwith this file. cd demo && pei-docker-cli configuredocker compose build stage-2 && docker compose up -d stage-2ssh dev@localhost -p 2222
Alternatives:
- If you want the same kind of minimal SSH container without
stage_2, see Build Modes for the runnablestage-1-onlyvariant. - If you want to keep both stages but build with a plain
docker buildworkflow, use the merged-build walkthrough on Build Modes.
Read Two-Stage Architecture if you want to understand why the default model keeps stage-1 and stage-2 separate.