Sign inSign up

davidsmith3/glab

By davidsmith3

•Updated 11 months ago

Docker-wrapped CLI tool

Image
0

435

davidsmith3/glab repository overview

⁠GLAB - GitLab CLI Docker Wrapper

Docker Pulls Docker Image Size GitHub License GitHub Release

A GitLab CLI tool bringing GitLab to your command line

Note: Check the official documentation⁠ for the latest supported features and commands.

⁠Contents

⁠Quick Start

curl -fsSL https://raw.githubusercontent.com/zero-to-prod/glab/main/install.sh | bash
⁠Manual Setup
# Pull the image
docker pull davidsmith3/glab:latest

# Authenticate (one-time setup)
docker run -it --rm -v ~/.config/glab-cli:/root/.config/glab-cli davidsmith3/glab auth login

# Run a command (example - requires a git repository)
docker run --rm -v ~/.config/glab-cli:/root/.config/glab-cli -v $(pwd):/workspace -w /workspace davidsmith3/glab issue list
⁠Creating Shell Aliases

For convenience, create an alias in your shell configuration (.bashrc, .zshrc):

alias glab='docker run --rm -v ~/.config/glab-cli:/root/.config/glab-cli -v $(pwd):/workspace -w /workspace davidsmith3/glab'

Note: The alias omits -it flags to work in both interactive and non-interactive contexts. Add -it manually when needed for interactive commands like auth login.

⁠Prerequisites

Before using this Docker image, ensure you have:

  • Docker: Version 20.10+ or Docker Desktop (Windows/Mac)
  • Docker Compose (optional): Version 1.29+

⁠Installation

Pull the latest image from Docker Hub:

docker pull davidsmith3/glab:latest
⁠Option 2: Using Docker Compose

Create a docker-compose.yml:

services:
  glab:
    image: davidsmith3/glab:latest
    container_name: glab
    volumes:
      - ~/.config/glab-cli:/root/.config/glab-cli
    environment:
      - TZ=UTC

Run with:

docker-compose run --rm glab --help
⁠Available Tags
  • latest - Current stable release (recommended)
  • {X.Y.Z} - Specific versions (e.g., 1.1.3)
  • {X.Y} - Major.minor versions (e.g., 1.1)

⁠Configuration

⁠Authentication Setup (Required)

GLAB requires authentication to connect to your instance.

⁠Step 1: Create Local Configuration

Configure GLAB with your credentials:

docker run -it --rm -v ~/.config/glab-cli:/root/.config/glab-cli davidsmith3/glab auth login

Follow the interactive prompts to complete authentication.

⁠Environment Variables

Optional environment variables you can set:

docker run --rm \
  -e TZ=UTC \
  -v ~/.config/glab-cli:/root/.config/glab-cli \
  -v $(pwd):/workspace \
  -w /workspace \
  davidsmith3/glab [COMMAND]

Note: Add -it flag for interactive commands like auth login.

⁠Volume Mounts

Essential volumes:

VolumePurposeRequired
~/.config/glab-cli:/root/.config/glab-cliConfiguration & credentialsYes
$(pwd):/workspaceCurrent directory accessOptional

Example with workspace mount (recommended for most commands):

docker run --rm \
  -v ~/.config/glab-cli:/root/.config/glab-cli \
  -v $(pwd):/workspace \
  -w /workspace \
  davidsmith3/glab [COMMAND]

Most glab commands require git repository context and should use the workspace mount pattern above.

⁠Security Considerations
  • Configuration files are stored in ~/.config/glab-cli on your host machine
  • Never commit .config/glab-cli to version control
  • Ensure file permissions are restrictive: chmod 700 ~/.config/glab-cli
  • Use API tokens instead of passwords for authentication

⁠Usage

⁠Basic Command Structure
# For commands that need git repository context
docker run --rm \
  -v ~/.config/glab-cli:/root/.config/glab-cli \
  -v $(pwd):/workspace \
  -w /workspace \
  davidsmith3/glab [COMMAND] [OPTIONS]

# For interactive commands (like auth login)
docker run -it --rm \
  -v ~/.config/glab-cli:/root/.config/glab-cli \
  davidsmith3/glab [COMMAND] [OPTIONS]
⁠Quick Reference

Display help:

# General help
docker run --rm davidsmith3/glab --help

# Command-specific help
docker run --rm davidsmith3/glab [COMMAND] --help
⁠Common Use Cases

Example commands:

# List issues in current repository
docker run --rm \
  -v ~/.config/glab-cli:/root/.config/glab-cli \
  -v $(pwd):/workspace \
  -w /workspace \
  davidsmith3/glab issue list

# View repository information
docker run --rm \
  -v ~/.config/glab-cli:/root/.config/glab-cli \
  -v $(pwd):/workspace \
  -w /workspace \
  davidsmith3/glab repo view

After adding the alias (see Creating Shell Aliases⁠), restart your shell or run source ~/.bashrc. Then you can use:

# Use the alias for simpler commands
glab issue list
glab repo view

# For interactive commands, add -it manually
docker run -it --rm -v ~/.config/glab-cli:/root/.config/glab-cli davidsmith3/glab auth login
⁠Using Docker Compose
# Run a command
docker-compose run --rm glab issue list

# Interactive mode
docker-compose run --rm glab

⁠Image Information

⁠Docker Hub
⁠Updating the Image
# Pull the latest version
docker pull davidsmith3/glab:latest

# Verify the update
docker run --rm davidsmith3/glab --version

⁠Development

For development or custom builds, see Image Development⁠.

⁠Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues⁠ page if you want to contribute.

Please read our:

⁠How to Contribute
  1. Fork the repository
  2. Create a new branch (git checkout -b feature-branch)
  3. Make your changes
  4. Commit changes (git commit -m 'Add some feature')
  5. Push to the branch (git push origin feature-branch)
  6. Create a Pull Request

⁠License

This project is licensed under the MIT License - see LICENSE.md⁠ for details.


Maintained by: zero-to-prod⁠ Last Updated: 2025-11-16

Tag summary

Content type

Image

Digest

sha256:71f01d701…

Size

25.2 MB

Last updated

11 months ago

docker pull davidsmith3/glab