Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
/ gh-cli Public archive

GitHub CLI inside the docker container.

License

Notifications You must be signed in to change notification settings

solairen/gh-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About:

  • OS: Alpine Linux 3.17.1

This docker container contains:

Tag version

Check latest container tag version and change with proper tag version.

How to build or download:

To build docker images from Dockerfile:

  • docker build . -t {tagname}

Download from Docker repository:

  • docker pull moleszek/ghcli:

To run GHCLI Docker image directly:

Windows:

docker run --rm -ti -e TOKEN=$env:GHTOKEN -v <pathToGitRepository>:/gh -v <pathToConfig>:/root/.config/gh/ -v <pathToSSH>:/root/.ssh/ moleszek/ghcli:<tag>

Linux:

docker run --rm -ti -e TOKEN=$GHTOKEN -v <pathToGitRepository>:/gh -v <pathToConfig>:/root/.config/gh/ -v <pathToSSH>:/root/.ssh/ moleszek/ghcli:<tag>

Important

To run this docker image correctly those things should be made before run:

  • TOKEN => GitHub token.
  • pathToGitRepository => path to folder where .git is created.
  • pathToConfig => path to folder where GitHub CLI config will be stored.
  • pathToSSH => path to .ssh keys.

Additional info

Set alias to be able to use this docker image as gh for example:

  • On windows open $PROFILE:
function gh_cli {
    docker run --rm -ti -e TOKEN=$env:GHTOKEN -v <pathToGitRepository>:/gh -v <pathToConfig>:/root/.config/gh/ -v <pathToSSH>:/root/.ssh/ moleszek/ghcli:<tag>

Set-Alias -Name gh -Value gh_cli
}

Save and restart $PROFILE:

. $PROFILE
  • On linux open ~/.bashrc:
alias gh="docker run --rm -ti -e TOKEN=$GHTOKEN -v <pathToGitRepository>:/gh -v <pathToConfig>:/root/.config/gh/ -v <pathToSSH>:/root/.ssh/ moleszek/ghcli:<tag>"

Save and restart .bashrc:

. ~/.bashrc