Skip to content

fix(atp): make the mounted data set writable in the test container - #103

Merged
sh00kapic merged 4 commits into
mainfrom
docs/atp-trim
Nov 22, 2026
Merged

sh00kapic merged 4 commits into
mainfrom
docs/atp-trim

Conversation

@nihilistaken

Copy link
Copy Markdown
Collaborator

What and why

On Linux, the ATP scenarios that create, rename or delete files fail: the app inside the
container cannot write to the mounted data set.

ubuntu:24.04 already ships a ubuntu user with UID 1000, so useradd tester got UID
1001. The data set mounted from the host belongs to the host user (UID 1000 on most Linux
machines) with owner-only write access, so tester could read it but not change it.
Docker Desktop on macOS remaps file owners, which hid the problem there.

  • Dockerfile: removes the ubuntu user and creates tester with the UID given by the
    new TESTER_UID build argument (default 1000).
  • build.sh: passes the host user's UID (id -u).

How it was checked

On WSL2 (Ubuntu), host UID 1000:

  • before: docker exec coretrace-gui-atp id showed uid=1001(tester), and creating a
    file from the app in /home/tester/workspace failed with a permission error;
  • after ./build.sh and ./run.sh: uid=1000(tester), and the scenarios that create,
    rename and delete files pass.

macOS is not affected: id -u gives 501 there, and Docker Desktop maps file owners anyway.

@sh00kapic

Copy link
Copy Markdown
Collaborator

PR #103 makes the acceptance-test container use the host user’s UID so the app can create, rename, and delete files in the mounted dataset on Linux.

Must fix

  1. The tester ZIP still ships the broken scripts. I inspected the archive at the PR head. Its build.sh and Dockerfile still use the old account setup, so testers who follow the delivery instructions will still hit the Linux write failure. Regenerate and commit the archive after fixing the scripts. Delivery instructions (https://github.com/CoreTrace/coretrace-gui/blob/134d21c8f2d818409f2c30ddcaad01dce830f2dc/atp/README.md#L3-L9) · Tester ZIP (https://github.com/CoreTrace/coretrace-gui/blob/134d21c8f2d818409f2c30ddcaad01dce830f2dc/atp/CoreTrace-GUI_ATP_appendices.zip)
  2. sudo ./build.sh now fails. The script passes TESTER_UID=0 under sudo, and useradd rejects UID 0 because it already belongs to root. Use the invoking user’s SUDO_UID when run through sudo, and reject a remaining UID 0 before starting Docker. Build script (https://github.com/CoreTrace/coretrace-gui/blob/134d21c8f2d818409f2c30ddcaad01dce830f2dc/atp/appendices/docker/build.sh#L12-L13) · Dockerfile (https://github.com/CoreTrace/coretrace-gui/blob/134d21c8f2d818409f2c30ddcaad01dce830f2dc/atp/appendices/docker/Dockerfile#L70-L73) · Docker’s Linux setup guide (https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
  3. The writable dataset is exposed through a passwordless desktop. run.sh publishes noVNC on all host interfaces by default. Anyone who can reach the port can control the app and, with this UID change, modify the mounted host files. Publish the port on loopback to match the documented local workflow. Port mapping (https://github.com/CoreTrace/coretrace-gui/blob/134d21c8f2d818409f2c30ddcaad01dce830f2dc/atp/appendices/docker/run.sh#L12-L16) · VNC setup (https://github.com/CoreTrace/coretrace-gui/blob/134d21c8f2d818409f2c30ddcaad01dce830f2dc/atp/appendices/docker/entrypoint.sh#L18-L19) · Docker port publishing (https://docs.docker.com/engine/network/port-publishing/)

Verdict Hold the merge. I verified the shipped ZIP and checked the build arguments with a stubbed Docker command. The end-to-end container run remains unverified.

- Regenerate the tester ZIP so it carries the new Dockerfile and scripts.
- build.sh uses the invoking user's UID under sudo (SUDO_UID) and stops before
  Docker if the UID is still 0.
- run.sh publishes noVNC on 127.0.0.1 only: it has no password and the data set
  is writable.
- useradd -l, so a large host UID (Git Bash) does not bloat the image.
- build.sh and run.sh are executable again.
@sh00kapic

Copy link
Copy Markdown
Collaborator
  • [P3] Reject zero-padded UID 0 before invoking Docker — /Users/shookapic/CoretraceProjects/coretrace-gui/atp/appendices/docker/build.sh:19-19
    With TESTER_UID=0000, build.sh invokes Docker because the guard compares strings. On a cold build, the tester can wait through the package downloads before useradd rejects the duplicate root UID. Validate the resolved UID as a positive decimal integer before starting the build so padded zero gets the same immediate diagnostic as 0.

nihilistaken and others added 2 commits November 20, 2026 16:41
build.sh compared the UID as a string, so TESTER_UID=0000 reached Docker and
failed only at useradd, after the package downloads. It now accepts only a
decimal number, strips leading zeros, rejects root and values above 4294967294,
and regenerates the tester ZIP.
@sh00kapic
sh00kapic merged commit 29245d7 into main Nov 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants