-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94254e2
commit fd8ae63
Showing
3 changed files
with
75 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
FROM debian:bookworm-slim | ||
|
||
RUN set -ex; \ | ||
apt-get update ; \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
git \ | ||
jq; \ | ||
FROM debian:trixie-slim | ||
|
||
RUN apt update && \ | ||
apt-get install ca-certificates wget curl git jq -y --no-install-recommends && \ | ||
mkdir -p -m 755 /etc/apt/keyrings && \ | ||
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null && \ | ||
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && \ | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \ | ||
apt update && \ | ||
apt install gh -y --no-install-recommends && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV GITHUB_CLI_VERSION 2.48.0 | ||
|
||
RUN set -ex; \ | ||
curl -L "https://github.com/cli/cli/releases/download/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_checksums.txt" -o checksums.txt; \ | ||
curl -OL "https://github.com/cli/cli/releases/download/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_amd64.deb"; \ | ||
shasum --ignore-missing -a 512 -c checksums.txt; \ | ||
dpkg -i "gh_${GITHUB_CLI_VERSION}_linux_amd64.deb"; \ | ||
rm -rf "gh_${GITHUB_CLI_VERSION}_linux_amd64.deb"; \ | ||
# verify gh binary works | ||
gh --version; | ||
|
||
ENTRYPOINT [ "gh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,64 @@ | ||
Welcome to GitHub Cli | ||
Welcome to GitHub CLI | ||
|
||
This Docker image provides a lightweight environment to run the GitHub CLI (`gh`) on a Debian-based system. It’s perfect for integrating GitHub commands into your CI/CD pipelines or any automated workflows. | ||
|
||
## Features | ||
|
||
- **Base Image**: Built on `debian:trixie-slim` for a minimal footprint. | ||
- **Installed Tools**: | ||
- `curl` | ||
- `git` | ||
- `jq` | ||
- `ca-certificates` | ||
- **GitHub CLI**: The latest version of GitHub CLI installed. | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
Make sure you have Docker installed on your machine. You can download it from [Docker's official website](https://www.docker.com/get-started). | ||
|
||
### Build the Image | ||
|
||
To build the Docker image, navigate to the directory containing the `Dockerfile` and run: | ||
|
||
```bash | ||
docker build -t github-cli . | ||
``` | ||
|
||
### Run the Container | ||
|
||
To run the GitHub CLI in a new container, use: | ||
|
||
```bash | ||
docker run --rm -it github-cli | ||
``` | ||
|
||
You can pass any `gh` command as an argument. For example: | ||
|
||
```bash | ||
docker run --rm -it github-cli auth login | ||
``` | ||
|
||
## Usage | ||
|
||
Once inside the container, you can use the `gh` commands just like you would on your local machine. For example: | ||
|
||
```bash | ||
gh repo list | ||
``` | ||
|
||
## Contributing | ||
|
||
If you want to contribute to this project, feel free to fork the repository and submit a pull request. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. | ||
|
||
## Acknowledgments | ||
|
||
- Thanks to the [GitHub CLI team](https://github.com/cli/cli) for their excellent work on the tool. | ||
- Inspired by the Debian community for providing a robust base image. | ||
|
||
Enjoy using the GitHub CLI in your Dockerized environments! |