{"id":17967144,"url":"https://github.com/serversideup/docker-github-cli","last_synced_at":"2025-08-16T15:31:46.919Z","repository":{"id":260004954,"uuid":"880032833","full_name":"serversideup/docker-github-cli","owner":"serversideup","description":"Have the power to run GitHub CLI on any machine in a containerized environment.","archived":false,"fork":false,"pushed_at":"2024-12-06T00:30:07.000Z","size":106,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-06T01:25:25.894Z","etag":null,"topics":["docker","gh-cli","github","github-cli"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/serversideup/github-cli","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serversideup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"serversideup"}},"created_at":"2024-10-29T01:43:18.000Z","updated_at":"2024-12-06T00:30:11.000Z","dependencies_parsed_at":"2024-10-29T02:36:52.796Z","dependency_job_id":"289d83ff-d885-4abb-94c3-656826b15d30","html_url":"https://github.com/serversideup/docker-github-cli","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":"0.11428571428571432","last_synced_commit":"4b3eef3e9c1fcd771b2b3e25978ef06cefe52d9a"},"previous_names":["serversideup/docker-github-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-github-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-github-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-github-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-github-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serversideup","download_url":"https://codeload.github.com/serversideup/docker-github-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230043146,"owners_count":18163966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","gh-cli","github","github-cli"],"created_at":"2024-10-29T14:04:17.408Z","updated_at":"2024-12-17T00:13:39.035Z","avatar_url":"https://github.com/serversideup.png","language":"Shell","funding_links":["https://github.com/sponsors/serversideup"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\t\u003cimg src=\"https://raw.githubusercontent.com/serversideup/docker-github-cli/main/.github/img/header.png\" width=\"1280\" alt=\"Docker Images Logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/serversideup/docker-github-cli/actions/workflows/action_publish-images-production.yml\"\u003e\u003cimg alt=\"Build Status\" src=\"https://img.shields.io/github/actions/workflow/status/serversideup/docker-github-cli/.github%2Fworkflows%2Faction_publish-images-production.yml\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/serversideup/docker-github-cli/blob/main/LICENSE\" target=\"_blank\"\u003e\u003cimg src=\"https://badgen.net/github/license/serversideup/docker-github-cli\" alt=\"License\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/sponsors/serversideup\"\u003e\u003cimg src=\"https://badgen.net/badge/icon/Support%20Us?label=GitHub%20Sponsors\u0026color=orange\" alt=\"Support us\"\u003e\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://hub.docker.com/r/serversideup/github-cli/\"\u003e\u003cimg alt=\"serversideup/github-cli pulls\" src=\"https://img.shields.io/docker/pulls/serversideup/github-cli?label=serversideup%2Fgithub-cli%20pulls\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://serversideup.net/discord\"\u003e\u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/910287105714954251?color=blueviolet\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n`serversideup/github-cli` is a lightweight solution for running GitHub CLI via Docker.\n\n## Features\n- 🐧 **Debian and Alpine** - Choose your OS\n- 🔒 **Unprivileged user** - Choose to run as root or an unprivileged user\n- 📌 **Pinned GitHub CLI Version** - Set your GitHub CLI version down to the patch version\n- 🔧 **Customize your \"run as\" user** - Customize the username to run as\n- 🔑 **Set your own PUID and PGID** - Have the PUID and PGID match your host user\n- 📦 **DockerHub and GitHub Container Registry** - Choose where you'd like to pull your image from\n- 🤖 **Multi-architecture** - Every image ships with x86_64 and arm64 architectures\n\n## Usage\nGetting started is easy. Here's a few tips on how to use this image.\n\n### Choose your registry\n\nOur images are available on Docker Hub and GitHub Container Registry 🥳\n\n**DockerHub:**\n- [serversideup/github-cli](https://hub.docker.com/r/serversideup/github-cli)\n\n**GitHub Container Registry:**\n- [ghcr.io/serversideup/github-cli](https://github.com/serversideup/docker-github-cli/pkgs/container/github-cli)\n\n| Variation | Image Size |\n| --------- | -------------------- |\n| `serversideup/github-cli` | [![DockerHub serversideup/github-cli:alpine](https://img.shields.io/docker/image-size/serversideup/github-cli/alpine?label=alpine)](https://hub.docker.com/r/serversideup/github-cli/tags?name=alpine)\u003cbr\u003e[![DockerHub serversideup/github-cli](https://img.shields.io/docker/image-size/serversideup/github-cli/latest?label=debian)](https://hub.docker.com/r/serversideup/github-cli)\n\n### Mounting directories\nThere are a few directories that we need to mount to ensure everything works correctly.\n\n#### Mounting the `/config` directory\nIn order to authenticate with GitHub, we need to mount your `~/.config` directory from your host into the container. We have a special `/config` directory that is symbolically linked from the unprivileged user's home directory. We use this root directory so you can change the `RUN_AS_USER` environment variable and not have to worry about having to predict what the absolute path to the configuration directory is. \n\nFor example, if you rename the `RUN_AS_USER` to something like `bob`, `/home/bob/.config` will be symbolically linked to `/config`, giving you a predictable path to mount your configuration files.\n\n#### Working with SSH\nSSH also behaves in a similar way. Keep reading below for more details.\n\n#### Mounting the `/app` directory\nWe also have a `/app` directory that is intended for you your workspace.\n\n### Change the \"run as\" user, PUID and PGID\n\n```bash\ndocker run --rm -it \\\n  -v \"$HOME/.ssh:/ssh:ro\" \\\n  -v \"$HOME/.ssh/known_hosts:/ssh/known_hosts:rw\" \\\n  -v \"$(pwd):/app\" \\\n  -v \"$HOME/.config/gh:/config/gh:rw\" \\\n  -e \"PUID=9999\" \\\n  -e \"PGID=9999\" \\\n  -e \"RUN_AS_USER=bob\" \\\n  serversideup/github-cli:latest gh --version\n```\n\n### Run a shell\n```bash\ndocker run --rm -it \\\n  -v \"$HOME/.ssh:/ssh\" \\\n  -v \"$(pwd):/app\" \\\n  serversideup/github-cli:latest /bin/sh\n```\n\n### Working with SSH\n\u003e [!NOTE]  \n\u003e Working with SSH keys can be tricky, especially if we're setting a `RUN_AS_USER` dynamically. We created a few things to help reduce the headache of getting this configured.\n\n#### The `/ssh` directory\nBy default, we have a `/ssh` directory that is symbolically linked from `~/.ssh`. The `/ssh` directory is used as our single source of truth for SSH keys and configurations.\n\nIf you set `RUN_AS_USER`, the entrypoint will create a home directory at `/home/${RUN_AS_USER}`, then create a symbolic link from `/home/${RUN_AS_USER}/.ssh` to `/ssh`. This gives you the power to set your `RUN_AS_USER` to anything you want without us needing to predict what user you want to run as.\n\n#### Mounting the SSH auth socket\nThe SSH auth socket is a Unix socket used by the SSH agent to communicate with other processes, allowing for secure key management. To use it with Docker, you can mount it as follows:\n\n**macOS:**\n```bash\ndocker run --rm -it \\\n  -v \"$HOME/.ssh:/ssh:ro\" \\\n  -v \"$HOME/.ssh/known_hosts:/ssh/known_hosts:rw\" \\\n  -v \"$(pwd):/app\" \\\n  -v \"/run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock\" \\\n  -e SSH_AUTH_SOCK=\"/run/host-services/ssh-auth.sock\" \\\n  serversideup/github-cli:latest gh --version\n```\n\nNotice how we're matching the `SSH_AUTH_SOCK` to the host's socket. This is necessary for the SSH agent to communicate with the container.\n\n**Linux:**\n```bash\ndocker run --rm -it \\\n  -v \"$HOME/.ssh:/ssh:ro\" \\\n -v \"$HOME/.ssh/known_hosts:/ssh/known_hosts:rw\" \\\n  -v \"$(pwd):/app\" \\\n  -v \"$SSH_AUTH_SOCK:$SSH_AUTH_SOCK\" \\\n  -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK\" \\\n  serversideup/github-cli:latest gh --version\n```\n\n### Environment Variables\nYou can customize the image easily with the following environment variables:\n\n| Variable | Default | Description |\n| -------- | ------- | ----------- |\n| `PUID` | `1000` | Set the User ID that you'd like to run GitHub CLI as |\n| `PGID` | `1000` | Set the Group ID that you'd like to run GitHub CLI as |\n| `RUN_AS_USER` | `github` | The username you'd like to run GitHub CLI as (this will be created for you and will default to an **unprivileged** user) |\n| `DEBUG` | `false` | Enable debug output of container startup |\n\n\n## Resources\n- **[DockerHub](https://hub.docker.com/r/serversideup/github-cli)** to browse the images.\n- **[Discord](https://serversideup.net/discord)** for friendly support from the community and the team.\n- **[GitHub](https://github.com/serversideup/docker-github-cli)** for source code, bug reports, and project management.\n- **[Get Professional Help](https://serversideup.net/professional-support)** - Get video + screen-sharing help directly from the core contributors.\n\n## Contributing\nAs an open-source project, we strive for transparency and collaboration in our development process. We greatly appreciate any contributions members of our community can provide. Whether you're fixing bugs, proposing features, improving documentation, or spreading awareness - your involvement strengthens the project. Please review our [code of conduct](./.github/code_of_conduct.md) to understand how we work together respectfully.\n\n- **Bug Report**: If you're experiencing an issue while using these images, please [create an issue](https://github.com/serversideup/docker-github-cli/issues/new/choose).\n- **Feature Request**: Make this project better by [submitting a feature request](https://github.com/serversideup/docker-github-cli/discussions/).\n- **Documentation**: Improve our documentation by [submitting a documentation change](./README.md).\n- **Community Support**: Help others on [GitHub Discussions](https://github.com/serversideup/docker-github-cli/discussions) or [Discord](https://serversideup.net/discord).\n- **Security Report**: Report critical security issues via [our responsible disclosure policy](https://www.notion.so/Responsible-Disclosure-Policy-421a6a3be1714d388ebbadba7eebbdc8).\n\nNeed help getting started? Join our Discord community and we'll help you out!\n\n\u003ca href=\"https://serversideup.net/discord\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/join-discord.svg\" title=\"Join Discord\"\u003e\u003c/a\u003e\n\n## Our Sponsors\nAll of our software is free an open to the world. None of this can be brought to you without the financial backing of our sponsors.\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/sponsors/serversideup\"\u003e\u003cimg src=\"https://521public.s3.amazonaws.com/serversideup/sponsors/sponsor-box.png\" alt=\"Sponsors\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n### Black Level Sponsors\n\u003ca href=\"https://sevalla.com\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/uploads/2024/10/sponsor-image.png\" alt=\"Sevalla\" width=\"546px\"\u003e\u003c/a\u003e\n\n#### Bronze Sponsors\n\u003c!-- bronze --\u003eNo bronze sponsors yet. \u003ca href=\"https://github.com/sponsors/serversideup\"\u003eBecome a sponsor →\u003c/a\u003e\u003c!-- bronze --\u003e\n\n#### Individual Supporters\n\u003c!-- supporters --\u003e\u003ca href=\"https://github.com/GeekDougle\"\u003e\u003cimg src=\"https://github.com/GeekDougle.png\" width=\"40px\" alt=\"GeekDougle\" /\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u003ca href=\"https://github.com/JQuilty\"\u003e\u003cimg src=\"https://github.com/JQuilty.png\" width=\"40px\" alt=\"JQuilty\" /\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u003ca href=\"https://github.com/MaltMethodDev\"\u003e\u003cimg src=\"https://github.com/MaltMethodDev.png\" width=\"40px\" alt=\"MaltMethodDev\" /\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u003c!-- supporters --\u003e\n\n## About Us\nWe're [Dan](https://twitter.com/danpastori) and [Jay](https://twitter.com/jaydrogers) - a two person team with a passion for open source products. We created [Server Side Up](https://serversideup.net) to help share what we learn.\n\n\u003cdiv align=\"center\"\u003e\n\n| \u003cdiv align=\"center\"\u003eDan Pastori\u003c/div\u003e                  | \u003cdiv align=\"center\"\u003eJay Rogers\u003c/div\u003e                                 |\n| ----------------------------- | ------------------------------------------ |\n| \u003cdiv align=\"center\"\u003e\u003ca href=\"https://twitter.com/danpastori\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/uploads/2023/08/dan.jpg\" title=\"Dan Pastori\" width=\"150px\"\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://twitter.com/danpastori\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg\" title=\"Twitter\" width=\"24px\"\u003e\u003c/a\u003e\u003ca href=\"https://github.com/danpastori\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg\" title=\"GitHub\" width=\"24px\"\u003e\u003c/a\u003e\u003c/div\u003e                        | \u003cdiv align=\"center\"\u003e\u003ca href=\"https://twitter.com/jaydrogers\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/uploads/2023/08/jay.jpg\" title=\"Jay Rogers\" width=\"150px\"\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://twitter.com/jaydrogers\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg\" title=\"Twitter\" width=\"24px\"\u003e\u003c/a\u003e\u003ca href=\"https://github.com/jaydrogers\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg\" title=\"GitHub\" width=\"24px\"\u003e\u003c/a\u003e\u003c/div\u003e                                       |\n\n\u003c/div\u003e\n\n### Find us at:\n\n* **📖 [Blog](https://serversideup.net)** - Get the latest guides and free courses on all things web/mobile development.\n* **🙋 [Community](https://community.serversideup.net)** - Get friendly help from our community members.\n* **🤵‍♂️ [Get Professional Help](https://serversideup.net/professional-support)** - Get video + screen-sharing support from the core contributors.\n* **💻 [GitHub](https://github.com/serversideup)** - Check out our other open source projects.\n* **📫 [Newsletter](https://serversideup.net/subscribe)** - Skip the algorithms and get quality content right to your inbox.\n* **🐥 [Twitter](https://twitter.com/serversideup)** - You can also follow [Dan](https://twitter.com/danpastori) and [Jay](https://twitter.com/jaydrogers).\n* **❤️ [Sponsor Us](https://github.com/sponsors/serversideup)** - Please consider sponsoring us so we can create more helpful resources.\n\n## Our products\nIf you appreciate this project, be sure to check out our other projects.\n\n### 📚 Books\n- **[The Ultimate Guide to Building APIs \u0026 SPAs](https://serversideup.net/ultimate-guide-to-building-apis-and-spas-with-laravel-and-nuxt3/)**: Build web \u0026 mobile apps from the same codebase.\n- **[Building Multi-Platform Browser Extensions](https://serversideup.net/building-multi-platform-browser-extensions/)**: Ship extensions to all browsers from the same codebase.\n\n### 🛠️ Software-as-a-Service\n- **[Bugflow](https://bugflow.io/)**: Get visual bug reports directly in GitHub, GitLab, and more.\n- **[SelfHost Pro](https://selfhostpro.com/)**: Connect Stripe or Lemonsqueezy to a private docker registry for self-hosted apps.\n\n### 🌍 Open Source\n- **[AmplitudeJS](https://521dimensions.com/open-source/amplitudejs)**: Open-source HTML5 \u0026 JavaScript Web Audio Library.\n- **[Spin](https://serversideup.net/open-source/spin/)**: Laravel Sail alternative for running Docker from development → production.\n- **[Financial Freedom](https://github.com/serversideup/financial-freedom)**: Open source alternative to Mint, YNAB, \u0026 Monarch Money.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserversideup%2Fdocker-github-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserversideup%2Fdocker-github-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserversideup%2Fdocker-github-cli/lists"}