Skip to content

fix(cli): respect rootless Docker in compose socket and SSH host - #497

Open
santhiprakash wants to merge 1 commit into
oblien:mainfrom
santhiprakash:fix/rootless-docker-482
Open

fix(cli): respect rootless Docker in compose socket and SSH host#497
santhiprakash wants to merge 1 commit into
oblien:mainfrom
santhiprakash:fix/rootless-docker-482

Conversation

@santhiprakash

Copy link
Copy Markdown
Contributor

Problem

openship up --compose hardcoded the rootful Docker socket path and the host.docker.internal SSH host, which breaks rootless Docker installs:

  • /var/run/docker.sock:/var/run/docker.sock is not the right socket for rootless Docker.
  • extra_hosts: ["host.docker.internal:host-gateway"] and OPENSHIP_HOST_SSH_HOST=host.docker.internal cannot be overridden, so the container cannot reach sshd under rootless networking.

Closes #482.

Changes

  • Derive the host-side Docker socket from OPENSHIP_DOCKER_SOCKET, DOCKER_HOST, the active docker context, or rootless fallbacks ($XDG_RUNTIME_DIR/docker.sock, /run/user/<uid>/docker.sock), defaulting to /var/run/docker.sock.
  • Always mount the resolved socket at /var/run/docker.sock inside the API container so the API's default still works.
  • Make OPENSHIP_HOST_SSH_HOST overridable and preserved across openship up re-runs, defaulting to host.docker.internal.
  • Use variable interpolation in the generated compose file so extra_hosts and the socket mount follow the resolved .env values.
  • Add unit tests for DOCKER_HOST, XDG_RUNTIME_DIR, explicit .env overrides, and OPENSHIP_HOST_SSH_HOST preservation.

Verification

  • bun run --cwd apps/cli lint passes.
  • bun run --cwd apps/cli test passes (233 tests).

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.

Support for Rootless Docker: Hardcoded docker.sock and host-gateway cause 502s

1 participant