Skip to content

Let the container image run as a non-root UID - #77

Merged
Vonng merged 1 commit into
mainfrom
claude/docker-image-fixes
Nov 9, 2026
Merged

Vonng merged 1 commit into
mainfrom
claude/docker-image-fixes

Conversation

@Vonng

@Vonng Vonng commented Nov 9, 2026

Copy link
Copy Markdown
Member

Contribution Licensing (no CLA, inbound=outbound, DCO required)

This pull request contributes to PGSTY SILO mcli (pgsty/mc). Code contributions
are accepted under AGPL-3.0-or-later, the same license as the client.
This project does not use a CLA or require a separate Apache-2.0 license grant.
By submitting this pull request I represent that I have the right to contribute
the code changes under this repository's
GNU AGPL v3.0 or later
and retain copyright in my original work. Existing copyright and license
notices remain intact; separately licensed material keeps its applicable terms.
Every commit must carry a DCO Signed-off-by
trailer (git commit -s) certifying the
Developer Certificate of Origin —
see CONTRIBUTING.md.

Description

Dockerfile.goreleaser now pre-creates /.mc with mode 1777.

Motivation and Context

A UID with no passwd entry gets HOME=/ from Docker and Kubernetes, so the image's mcli tried to create /.mc. Every command then failed with mkdir /.mc: permission denied, even one that only uses MC_HOST_*. That broke --user and runAsNonRoot unless MC_CONFIG_DIR was set.

How to test this PR?

Built locally (linux/arm64) from the RELEASE.2026-10-26T00-00-00Z binary:

  • As --user 10001:10001: an MC_HOST_* command reaches the network, and alias import followed by alias list works.
  • As root with -v dir:/root/.mc: the alias is written to the mounted directory.
  • An unwritable explicit MC_CONFIG_DIR still fails.
  • --read-only with MC_CONFIG_DIR pointing at a tmpfs works.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • All commits are signed off (git commit -s) per the DCO
  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Public documentation update opened in pgsty/silo.pgsty.com, if needed

🤖 Generated with Claude Code

A UID without a passwd entry gets HOME=/ from Docker and Kubernetes, so
mcli tried to create /.mc and every command failed with "mkdir /.mc:
permission denied", even one that only uses MC_HOST_*. Pre-create /.mc
with mode 1777. Root keeps /root/.mc, so existing mounts are unaffected,
and --config-dir / MC_CONFIG_DIR still take precedence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Feng Ruohang <rh@vonng.com>
@Vonng
Vonng merged commit e12df4e into main Nov 9, 2026
8 checks passed
@Vonng
Vonng deleted the claude/docker-image-fixes branch November 9, 2026 01:38
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.

1 participant