Skip to content

Support configurable UID/GID for clide user (bind mount permissions) #53

Closed

Description

@itscooleric

Problem

When /workspace (or any working directory) is bind-mounted from the host, files are owned by the host user's UID (typically 1000). Inside the container, the clide user is UID 1001, so it can't write to the mounted directory.

Current workaround: chmod -R a+w from the host, or docker exec -u root to chown. Both are manual and easy to forget.

Fix

Make the clide user's UID/GID configurable via build args, defaulting to 1000 (the most common host UID):

Dockerfile

ARG CLIDE_UID=1000
ARG CLIDE_GID=1000
RUN groupadd -g ${CLIDE_GID} clide && \
    useradd -m -u ${CLIDE_UID} -g ${CLIDE_GID} clide

docker-compose.yml

services:
  claude:
    build:
      args:
        - CLIDE_UID=${CLIDE_UID:-1000}
        - CLIDE_GID=${CLIDE_GID:-1000}

Users with non-standard UIDs can override via .env or environment:

CLIDE_UID=$(id -u) CLIDE_GID=$(id -g) docker compose build

Notes

  • Default should change from 1001 → 1000 since that's the standard first non-root user on most Linux distros and macOS.
  • This only affects the build step — no runtime overhead.
  • The entrypoint's gosu clide drop continues to work as-is since it references the username, not the UID.
  • Existing containers need a rebuild to pick up the change.

Size

XS

Activity

  1. added a commit that references this issue on Mar 8, 2026
    924e494
  2. added a commit that references this issue on Apr 23, 2026
    6d8bac0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions