Docker Compose is the source of truth for syntax, profiles, interpolation and resolved configuration. BeforeUp does not attempt to replace it.
Two existing projects cover other parts of the problem:
- juanfadev/compose-preflight: checks operational configuration risks.
- kost-tech/compose-preflight: checks risky Compose security settings.
BeforeUp focuses instead on a small set of facts about the actual host: live listeners, missing bind sources, access to Docker Engine and free space in Docker's data filesystem.
On the native Debian VPS with Docker Compose 5.7.0 and Go 1.26.7, a synthetic Compose file using privileged: true, cap_add: [SYS_ADMIN, NET_ADMIN], security_opt: [seccomp=unconfined, apparmor=unconfined], a read-only bind source named docker.sock and host network/PID/IPC namespaces passed docker compose config. The unmodified BeforeUp main reported no security findings. The patch reported seven warning categories for that service under check and compare, one additional warning for an explicitly selected profile, and zero warnings for a normal service.
The scenario used a deliberately remote Docker endpoint, so BeforeUp skipped local host probes. Normal warning-only runs exited 0; --strict exited 1 without changing finding severity. Synthetic environment content and bind-source path markers did not appear in JSON output. No image was pulled and no container was created. Go unit tests also cover safe controls, deterministic ordering, inactive profiles, privacy and remote-engine behavior. The repository's reproducible read-only Compose matrix now includes four security cases (18 cases total). make check, go test -race ./..., the opt-in Compose config integration and CI exit-code/redaction contract all passed. Version-specific Compose runtime guards were skipped for Compose 5.7.0, not generalized from the four independently reproduced 5.5/5.6 releases. This evidence does not establish image vulnerability scanning, actual pullability, successful container startup or application health.
BeforeUp 0.4.4 reports three warning IDs for two runtime-failure families independently reproduced on Debian 13, Docker Engine 29.8.1, rootful AppArmor, with Compose 5.5.0, 5.5.1, 5.6.0 and 5.6.1:
restart: alwaysplusdeploy.restart_policy.delaywithoutconditionlaunched with restart policyno, while explicitcondition: anypreservedalways. Amax_attempts-only variant failed creation instead (not a silent failure), including when no service-level restart was configured or whencondition: anywas specified. Expliciton-failurewithmax_attempts: 3launched successfully in native controls.pre_start.per_replica: truepassed Compose config validation but failedcompose upwith an unsupported-feature error.- Focused Go tests cover version scope, inactive profiles, safe controls, warning order and strict mode. Fourteen read-only native Compose CLI fixtures on each of the four verified Compose versions test real parsing and the 0.4.4 binary output. A normal
pre_starthook with three replicas succeeded in separate real-Engine controls. Other Compose versions and operating systems are not certified.
Extended regression matrix: delay-only overrides for restart: always, unless-stopped and on-failure; missing and explicit-any conditions with positive max_attempts; and an empty deploy restart-policy object all matched real Engine outcomes on Compose 5.5.0, 5.5.1, 5.6.0 and 5.6.1. No-restart delay-only and explicit condition:on-failure + max_attempts remain negative controls. All disposable projects and any created hook containers were removed after inspection. The make check formatting command now fails when gofmt is missing or exits unsuccessfully; both negative controls were exercised.
These diagnostics were published in BeforeUp 0.4.4. Detailed independent Engine reproduction evidence remains in the private research repository; the public regression fixtures document the behavior without exposing private host details.
On a Debian Linux VPS running Docker Compose v5.5.1:
- A test Compose project declared port 8080 and a long bind mount pointing to an absent path with
create_host_path: false. docker compose -f compose.yaml config --quietexited successfully.- BeforeUp reported
PORT_IN_USEas a warning because a listener was present on the host andBIND_MISSINGas a blocker because the required path was absent. - The tool did not create the path or start containers.
- A synthetic environment variable included in the Compose project did not appear in the text or JSON report.
The port warning does not prove a restart would fail, since the listener could belong to an existing container in the same project. The bind finding is stronger because Compose is explicitly prohibited from creating the missing path.
Two services publishing the same host port were also accepted by Compose configuration validation; BeforeUp now reports that collision as a blocker.
A deliberately high disk threshold also triggered DISK_LOW. This validates the warning branch; it is not evidence that the VPS was short of disk space.
Two existing Compose projects on the same host were also inspected without launching or changing their services. Both produced only the expected busy-port warnings and no confirmed blockers. This is a local compatibility check, not independent field validation.
- Go unit tests with fake command execution, socket outputs, Docker contexts and filesystem state.
- Optional integration test against the installed Docker Compose CLI.
- A non-mutating inspection on the live Linux host.
- Go formatting and vet.
- Output review for synthetic secret disclosure.
Before widespread recommendation, obtain feedback from independent developers working with real Compose projects. Investigate false positives in rootless Docker, unusual network namespaces and IPv6 dual-stack listeners. Extend operating-system support only when these checks can be tested there.
Results from independent users have not yet been collected. Usage, downloads and stars should not be presented as proof of quality.
The preview comparison was tested against two running Compose projects on the maintainer's Linux VPS. In an unmodified PostgreSQL service, BeforeUp recognized that its published port belonged to the same running service and found no port or mount changes. An alternate Compose override proposed a different published port. Docker Compose accepted the override; BeforeUp reported both the port being removed and the proposed replacement. No containers were restarted.
Another running application was inspected. The initial comparison mistook a Compose-generated named volume identifier for a volume change. A regression test was written and the comparison fixed to resolve the logical Compose volume name. After the correction, the remaining differences related to actual host bind-source paths from different release directories.
A 16-case synthetic validation matrix was executed with docker compose config and the BeforeUp Linux binary. The cases covered valid and invalid configuration, required and auto-created bind sources, ports owned by the same or another Compose project, duplicate published ports, active and inactive Compose profiles, low disk thresholds, existing bind sources, IPv4 binding and protocol distinctions, and image references that are not checked at this stage. Fifteen configurations were accepted by Compose; one missing required variable was rejected by Compose and BeforeUp. BeforeUp identified extra host-side findings in the relevant accepted scenarios.
The portable subset of 14 cases is reproducible via python3 tests/compose_matrix.py --binary ./beforeup after compiling the tool. The two host-dependent port ownership scenarios were exercised separately against the actual running VPS and through isolated Go regression tests. This fixture script never starts or removes containers.
The matrix also caught a bug: Compose can validly select zero services when all are disabled by profiles. BeforeUp now reports NO_ACTIVE_SERVICES without claiming the Compose file is invalid. It does not verify whether a referenced image can be downloaded; the image-reference case remains a documented gap.
All these cases are internal tests. No independent developer adoption has yet been measured, and competing tools were compared at the documentation/feature level rather than through an independently validated execution benchmark. These results do not establish superiority over other products.
Stack Overflow questions about environment values not updating after docker compose restart, host ports already allocated and bind-mount problems were reviewed. An existing Komodo GitHub issue discusses Compose interpolation and container recreation. References, native workarounds and the checks BeforeUp can or cannot provide are recorded in common issues.
For the environment-change case, new Go tests compare only environment settings explicitly present in the proposed resolved Compose model against running container values. Extra variables inherited from an image are not treated as configuration changes. Sensitive names and values are withheld from diagnostics. Other tests cover changed image references, failed metadata inspection and services that no longer appear in the proposal.
The change was exercised in read-only mode against two running Compose projects on the maintainer VPS. This is not independent field validation. No replies or promotional posts were made in community discussions.
Questions about docker compose pull, unchanged image tags and whether docker compose up recreates a container led to a targeted read-only check. BeforeUp now compares the image ID used by the running container against the ID of the image currently available locally for that tag. It reports LOCAL_IMAGE_UPDATED only when both IDs are valid and different. If the image is unavailable locally, the check makes no claim. Services pinned to another platform are excluded from this comparison until platform-sensitive checks are supported. The check makes no remote registry request.
The regression was reproduced before the change and passes after it. It includes a case with matching local IDs and one where the local image cannot be inspected. No image was pulled and no container was recreated.
A static Linux/amd64 binary executed beforeup version successfully in ten isolated OCI base images: Ubuntu 24.04 and 26.04, Debian 12 and 13, Alpine 3.22, Fedora 43, Rocky 9, Arch Linux rolling, openSUSE Leap 15.6 and Amazon Linux 2023. These tests used no host Docker socket or network inside containers. They establish only executable startup, not full Engine integration.
A Debian package was built for amd64 and arm64. The amd64 package installed, ran and was removed without leftover executable on Debian 13 and Ubuntu 24.04/26.04. The arm64 package passed archive metadata inspection; ARM runtime testing remains pending. See platform support.
The first 0.3.2 preview release exposed a packaging-manifest mismatch: GitHub sanitized the tilde in uploaded .deb asset filenames, but the checksum file still referenced the original tilde. The release check reproduced the failure. Package build output now uses GitHub-compatible period filenames while retaining the correct ~preview version inside Debian control metadata; the release assets and checksum list are verified after downloading.
Before this change, an additional running container belonging to a Compose service caused the entire running-stack comparison to return BASELINE_UNKNOWN. A regression test first reproduced this behavior. The fix reports REPLICAS_UNSUPPORTED for that service and continues to compare other services. It never returns a project-wide RUNNING_MATCH when any replica is skipped.
The behavior was exercised using three disposable containers on the maintainer's Debian VPS: two isolated worker replicas and one independent api container with synthetic Compose labels. They ran without host networking, published ports or writable root filesystems, under limited CPU and memory. The test containers were removed afterwards. This validates partial comparison behavior; BeforeUp still cannot fully compare replica configurations.
An early regression pass showed that Unix-socket Docker Desktop contexts could be mistaken for the workstation's native Docker Engine, that rootless bind sources could be treated as accessible merely because the path existed, and that cross-family IPv4/IPv6 wildcard port claims could be described as proven collisions. Synthetic regressions were added for these cases and passed after the fixes.
For Docker Desktop Linux, docker info identifies the VM-backed daemon. The host socket, local filesystem and disk probes are skipped, while container-metadata comparison remains eligible. For rootless engines, the security options are inspected; an existing bind produces an explicit unverified permission warning. A low published host port is also a warning when its system privilege threshold is not known to allow the port. RootlessKit capabilities may still permit it. Nothing is changed on the host.
The IPv6 check was exercised in an actual read-only scenario on the Debian VPS. A temporary loopback listener on ::1:19537 was detected as PORT_IN_USE. A synthetic Compose project publishing TCP port 19538 separately on 0.0.0.0 and :: was accepted by docker compose config and generated PORT_DUAL_STACK_UNCERTAIN, not a confirmed blocker. docker compose --dry-run up -d simulated the project without creating any containers; it did not provide the same explicit cross-family uncertainty explanation. Ports were not opened to the public network.
A rootless policy regression also verified that multiple low ports read the host sysctl at most once. The optional --strict flag was exercised end-to-end on a profile-only Compose fixture. Normal invocation returned exit 0 with one warning, while --strict returned exit 1 for the same JSON result. Invalid configuration still exits 2. Docker Desktop Linux and enforced SELinux were not live-tested on separate engines. An isolated rootless daemon smoke test followed; see below. These results do not establish full platform support.
A packaging regression run also caught an over-conservative classification: two services publishing an identical port with both host IPs omitted were being reported as uncertain, although their default host bindings must collide. A failing Go regression was added. The default/default and default/IPv4 cases are now confirmed collisions; cross-family IPv4/IPv6 overlap remains uncertain. The 14-case Compose matrix is retained as an independent guard against future reintroduction.
A separate rootless Docker daemon was started under an unprivileged account with its own data and runtime directories, a Unix socket and no host bridge or iptables changes. The standard Docker Engine remained operational. BeforeUp detected name=rootless in Docker's security options and reported ROOTLESS_BIND_UNVERIFIED for an existing bind source without claiming write permissions. On this host it also warned about a privileged host port. No rootless application container was launched, so actual container UID/GID write access and published-port behavior remain unverified.
The first isolated startup failed because RootlessKit could not configure a TUN/TAP device in the VPS environment. A second attempt with network driver none, MTU 0 and detached network namespace disabled started successfully without changes to the production daemon. The reproducible, no-container-startup test is tests/rootless-smoke.sh; it requires already installed rootless Docker prerequisites and a suitable Linux host. Test files and the rootless daemon were removed at the end. The result verifies daemon detection and cautious host warnings, not rootless application compatibility.
Tests reproduced three defects in the earlier comparison logic: scaled services absent from a proposed Compose model were not reported, the first container of a known multi-replica service was inspected unnecessarily (which could abort the whole comparison), and mount destinations from Docker runtime metadata were included verbatim in a finding. The changes now enumerate replicas before inspecting singleton services, detect orphaned scaled services, and withhold both mount source and target paths from reports.
Two further regressions cover deterministic orphan warning order and concise counts when multiple mounts change for the same service. The report preserves stable finding IDs without emitting repeated, indistinguishable warnings per path. The public Makefile also distinguishes a non-mutating formatting check from the optional formatter.
The scaled-orphan comparison was also exercised against three disposable Docker containers on the maintainer VPS: two replicas of an 'old' service absent from the proposal and one 'web' service in the proposal. BeforeUp returned 'SERVICE_ABSENT_FROM_PROPOSAL' for the retired service, did not claim a project-wide match, and the test removed all three containers and associated temporary configuration immediately afterwards. No production containers were modified.
Six unmodified Compose files from Docker Awesome Compose were tested with both docker compose config -q and BeforeUp: wordpress-mysql, postgresql-pgadmin, nginx-nodejs-redis, prometheus-grafana, gitea-postgres and nextcloud-redis-mariadb. All six configurations resolved successfully; BeforeUp completed each read-only host scan without blockers. The examples were copied without their adjacent files and no application images were launched. Expected observations included host ports already claimed by unrelated projects, absent Prometheus/Grafana bind directories, and three missing build-context references in NGINX/Node.js/Redis. The latter were not detected before this change. No production paths or credentials from the maintainer's VPS were included in the test configurations.
An additional disposable Alpine Compose service was actually started using a pre-cached image, no network, no public ports and a read-only root filesystem. BeforeUp compare reported RUNNING_MATCH for the original file. After changing an environment value and bind mount source, the same command reported ENV_CHANGED and MOUNT_SOURCE_CHANGED, without disclosing the private host path. The test project and resources were removed. Reproduce with sh tests/live-compare-smoke.sh /path/to/beforeup on an authorized host with alpine:3.22 cached.
A separate container write test on a disposable 0700, root-owned bind directory demonstrated that application UID 1000 cannot write while root can. This was tested with the regular Docker daemon, not rootless. An isolated rootless daemon was started and an Alpine image loaded, but starting its container failed due to missing AppArmor profile access, then cgroup delegation in the VPS session. The rootless daemon and temporary storage were removed. The result does not prove rootless container write behavior; the remaining gap is tracked privately. No host cgroup, AppArmor or production Docker configuration was changed.
A repository-wide review examined the Go read-only command path, Docker calls and output bounds, reporting, secrets handling, package scripts, test harnesses, documentation and version alignment. Existing review_test.go from an interrupted audit was retained as a regression rather than discarded.
Three reproducible issues were closed. A local build context that was a regular file was previously treated as a valid directory; it now reports BUILD_CONTEXT_INVALID. The order of added/removed port findings was map-dependent; it is now deterministic. A failed Docker published-port ownership lookup with an empty host socket list previously yielded a PORTS pass; it now reports PORT_OWNERS_UNKNOWN without claiming availability. These findings are warnings because no deployment failure was proven.
Quality verification includes formatting, unit and integration tests, race testing, static Go vet, a multi-scenario Docker Compose matrix, shell syntax checks and Debian package installation/removal. Public source checks remain read-only; no personal service config or secret data is committed. Linux Desktop, enforced SELinux, rootless application write access and real ARM64 installation remain outside this audit's evidence.
A black-box check using the published v0.4.3 Linux/amd64 release and an authorized local Docker Engine verified all five CLI status cases: clean project (0), warning-only (0), warning-only with --strict (1), missing required bind source (1), and invalid Compose configuration (2). The checks inspected parsed JSON findings and confirmed that a synthetic declared secret name/value and a bind-source path were withheld. Temporary Compose configurations were used; no containers, images or running stacks were changed. Reproduce with python3 tests/ci_contract.py --binary /path/to/beforeup. Reproduction requires a native Linux host with Compose and Docker Engine access and does not certify other environments. The Go compiler was not in the task account PATH during this documentation-only pass, so Go unit and race tests were not rerun; no Go runtime files changed.