Files
openssh-rpms/docker/README.md
boypt 7ae3bb4d1e docs: align UOS20 to EL8 image and map Recommended RPMs to CI artifacts
- README.md table: replace meaningless aarch64_el7/8/9 tags with actual CI
  artifacts (rpm-el5-x86_64/i686, rpm-el6-x86_64, rpm-el7/8/9-*,
  rpm-uos20-*), fuzzy version via artifact name; fix UOS20 row from
  aarch64_el7 to rpm-uos20-*
- README.md: UOS20=1 ./compile.sh el7 -> el8 (spec remains el7 via
  GUESS_DIST), anchor #uos-20-variant-el7-family -> #uos-20-variant-el8
- docker/README.md: UOS 20 Variant (EL7-family) -> (EL8), reuse EL7
  image / Dockerfile.centos:7 -> reuse EL8 image via
  Dockerfile.centos-stream:8 (with GUESS_DIST note), uos20- -> uos20.,
  build-args table EL7 -> EL8
2026-08-21 12:09:34 +08:00

4.7 KiB
Raw Blame History

elssh Build Guide Docker-based RPM Packaging

This document explains how to build elssh RPM packages for various Enterprise Linux versions using Docker.

You only need to build the versions you actually require. There is no need to run all commands.

All built RPM packages will be automatically placed in the ./output/ directory on your host machine.

Prerequisites

  • Docker (version 20+ recommended)
  • Git
  • Sufficient disk space (~10 GB+ recommended)
  • Internet connection

Step 1: Download Sources

You must download the source code and tarballs before building:

# Download all required sources
env ALL=1 ./pullsrc.sh

Note

: Run this command only once before starting any builds. It prepares all necessary files for every supported platform.

Step 2: Building RPMs for Specific Platforms

Choose only the platforms you need and run the corresponding commands.

x86_64 Builds

For EL5 (CentOS 5)

# Build Docker image
docker build -t elssh:el5 -f ./docker/Dockerfile.centos5 .

# Build 64-bit packages (recommended)
docker run --rm -v .:/data -e "M32=0" elssh:el5

# Build 32-bit packages (optional)
docker run --rm -v .:/data -e "M32=1" elssh:el5

For EL6 (CentOS 6)

docker build -t elssh:el6 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=6 .
docker run --rm -v .:/data elssh:el6

For EL7 (CentOS 7)

docker build -t elssh:el7 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=7 .
docker run --rm -v .:/data elssh:el7

UOS 20 Variant (EL8)

Reuse the EL8 image (CentOS Stream 8, el7/ spec via GUESS_DIST mapping) and pass UOS20=1 to enable the kernel-panic fix in sshd.c and prefix PKGREL with uos20. (so the resulting RPMs are distinguishable from the standard build).

docker build -t elssh:el8 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=8 .
docker run --rm -v .:/data -e "UOS20=1" elssh:el8

For EL8 (CentOS 8 / RHEL 8 / Rocky 8 / AlmaLinux 8)

docker build -t elssh:el8 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=8 .
docker run --rm -v .:/data elssh:el8

For EL9 (CentOS Stream 9 / RHEL 9 / Rocky 9 / AlmaLinux 9)

docker build -t elssh:el9 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 .
docker run --rm -v .:/data elssh:el9

aarch64 (ARM64) Builds

For EL8 aarch64

docker build -t elssh_aarch64:el8 \
  --platform linux/arm64 \
  -f ./docker/Dockerfile.centos-stream \
  --build-arg VERSION_NUM=8 .

docker run --rm -v .:/data --platform linux/arm64 elssh_aarch64:el8

For EL9 aarch64

docker build -t elssh_aarch64:el9 \
  --platform linux/arm64 \
  -f ./docker/Dockerfile.centos-stream \
  --build-arg VERSION_NUM=9 .

docker run --rm -v .:/data --platform linux/arm64 elssh_aarch64:el9

Build Arguments

Argument Values Description
VERSION_NUM 6,7,8,9 Specifies the target EL version (used in most Dockerfiles)
M32 (EL5 only) 0 or 1 0 = 64-bit, 1 = 32-bit
UOS20 0 or 1 1 = build the UOS 20 variant (EL8 image); enables the kernel-panic patch and prefixes PKGREL with uos20.

Note: Standalone Dockerfiles for Amazon Linux / openEuler / Rocky Linux have been consolidated into the generic EL images (reusing EL8/EL9 via glibc compatibility) and are no longer maintained separately.

Output Location

After each successful build, the RPM packages are copied to:

./output/

Typical output structure:

output/
├── el5/
│   ├── x86_64/
│   └── i686/          # only if M32=1
├── el6/
├── el7/
├── el8/
├── el9/
├── el8-aarch64/
└── el9-aarch64/

Each subdirectory contains the generated .rpm files (including debuginfo if available).

Quick Start Examples

Build only for modern systems (EL8 + EL9)

env ALL=1 ./pullsrc.sh

docker build -t elssh:el8 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=8 .
docker run --rm -v .:/data elssh:el8

docker build -t elssh:el9 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 .
docker run --rm -v .:/data elssh:el9

Build only for ARM64

env ALL=1 ./pullsrc.sh

docker build -t elssh_aarch64:el9 --platform linux/arm64 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 .
docker run --rm -v .:/data --platform linux/arm64 elssh_aarch64:el9

Troubleshooting

  • Permission issues: Run chown -R $USER output/ after building
  • Docker build fails on first run: This is normal — it needs to download base images and dependencies
  • ARM64 builds: Requires a machine with ARM64 support or Docker Buildx multi-platform enabled