Skip to content

Conversation

@jmgilman
Copy link
Collaborator

@jmgilman jmgilman commented Jan 1, 2026

Summary

  • Fix Docker service not auto-starting by moving systemctl enable docker to after systemd cleanup
  • Fix container startup failure by removing USER developer directive (systemd requires root)

Background

During manual functional testing of the base image with Apple Containerization Framework, two issues were discovered:

  1. Docker not starting automatically: The systemctl enable docker command was placed before the systemd cleanup step, which deleted all symlinks in multi-user.target.wants/, including the Docker service symlink.

  2. Container failing to start: The Dockerfile defaulted to USER developer, but systemd must run as root (PID 1). When Apple Containerization respects the USER directive, systemd would fail immediately.

Changes

  • Moved systemctl enable docker to after the systemd cleanup step (line 315)
  • Removed USER $USERNAME directive - container now runs as root by default
  • Added comment explaining the rationale

Test plan

  • Built image locally with docker build
  • Loaded into Apple Containerization with container image load
  • Verified container starts without -u root flag
  • Verified systemd runs as PID 1
  • Verified Docker service starts automatically
  • Verified Docker-in-Docker works (docker run, docker build, docker compose)

🤖 Generated with Claude Code

jmgilman and others added 2 commits December 31, 2025 16:28
Two issues were discovered during manual testing with Apple Containerization:

1. Docker service not starting automatically:
   - `systemctl enable docker` was called before the systemd cleanup step
   - The cleanup step deleted all symlinks in multi-user.target.wants/
   - Moved the enable command to after the cleanup to preserve the symlink

2. Container failing to start without `-u root`:
   - The Dockerfile set `USER developer` as the default
   - systemd must run as root (PID 1)
   - Removed the USER directive since agents need full control anyway

Tested with Apple Containerization Framework - both fixes verified working.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add hadolint ignore for DL3002 (USER root is intentional for systemd)
- Consolidate consecutive RUN instructions (DL3059)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jmgilman jmgilman merged commit a61515f into master Jan 1, 2026
1 check passed
@jmgilman jmgilman deleted the fix/base-image-systemd-docker branch January 1, 2026 00:38
jmgilman added a commit that referenced this pull request Jan 3, 2026
Current behavior:
Docker service was not starting automatically due to systemctl enable being called before cleanup step that removed symlinks, and container was defaulting to developer user which prevented systemd from running as PID 1

New behavior:
Docker systemctl enable is now called after systemd cleanup to preserve symlinks, container runs as root by default to support systemd and agent operations, and hadolint warnings are resolved with proper ignores and consolidated RUN instructions

Closes: #9
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