Files
shadow/docker/Dockerfile.debian
T
Pierre Warnier 97130fea20 scaffold: workspace, shadow-core, passwd tool, Docker test matrix
Cargo workspace with three-layer architecture mirroring uutils conventions:
- shadow-core: /etc/passwd and /etc/shadow parsers, atomic file writes,
  username validation, error types, feature-gated module stubs (PAM,
  SELinux, group, gshadow, login.defs, subid, nscd, lock, uid_alloc)
- uu_passwd: tool skeleton with clap CLI, uumain/uu_app pattern
- multicall binary: argv[0] dispatch with --list support

Docker test matrix (Debian Trixie, Alpine musl, Fedora SELinux):
all three pass clippy -D warnings, 21 tests, and cargo fmt --check.

21 unit tests covering:
- passwd/shadow file parsing and roundtrip serialization
- atomic file write with fsync + rename + failure rollback
- username validation rules (length, charset, edge cases)
- clap command definition
2026-03-23 11:57:10 +01:00

29 lines
796 B
Docker

# shadow-rs development image — Debian Trixie (13)
#
# PAM: libpam0g-dev (Linux-PAM)
# SELinux: libselinux1-dev
# Default shell: /bin/bash
# Shadow-utils package: login + passwd
# Note: Trixie is now the default Debian for the Rust Docker image.
FROM rust:latest
RUN apt-get update && apt-get install -y --no-install-recommends \
libpam0g-dev \
libselinux1-dev \
libaudit-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN rustup component add clippy rustfmt \
&& cargo install cargo-deny \
&& curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C /usr/local/cargo/bin
RUN useradd -m -s /bin/bash testuser \
&& useradd -m -s /bin/sh testuser2 \
&& groupadd testgroup \
&& usermod -aG testgroup testuser
WORKDIR /workspace
CMD ["/bin/bash"]