npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lobatolobato/docker-registry-cli

v1.5.0

Published

CLI for the docker registry v2

Downloads

18

Readme

DockerRegistryCLI

This is a cli application powered by NodeJS that provides easier interaction with a private docker registry.

Table of contents

General Information

This project aims to facilitate the interaction between a developer and a private docker registry by abstracting the Registry V2 HTTP API into simple single-line easy commands.

It uses both the docker engine, to build and push images, and the Registry V2 HTTP API, for the listing and removal of images.

Setup

Install docker if not already installed.
Install the application globally using npm:

$ npm install -g @lobatolobato/docker-registry-cli

Then run it with:

$ docker-registry-cli

Usage

The application provides the following commands to interact with the registry:

All of which can be run with or without a "GUI".

NO GUI (Currently not implemented)

  • list

    Lists repositories in the registry.

    # Lists all repositories in the registry
    $ docker-registry-cli list
    
    # Lists a specific repository in the registry
    $ docker-registry-cli list --repo "repo_name"
  • push

    Pushes a new image into the registry.

    # Pushes an already built image to the registry
    $ docker-registry-cli push imageName:tag
    
    # Builds the image from the provided Dockerfile and pushes it to the registry
    $ docker-registry-cli push imageName:tag --dockerfile "path/to/dockerfile"
    
    # Builds the image from the provided git repository and pushes it to the registry
    $ docker-registry-cli push imageName:tag --git "https://github.com/user/repository"
  • remove

    Removes or untags an image from the registry.

    # Removes or, if other tags reference it, untags an image from the registry
    $ docker-registry-cli remove image:tag
    
    # Removes an image and all tags related to it
    $ docker-registry-cli remove image:tag --purge
  • config

    Gets or modifies the application's configuration

    # Gets the current configuration
    $ docker-registry-cli config
    
    # Sets the value of a field in the configuration
    $ docker-registry-cli config --field "field" --value "value"
    
    # Sets the value of a subfield in the configuration
    $ docker-registry-cli config --field "field.subfield" --value "value"

    Fields:

    • registry_url: The url where the registry is located at. E.g.: http://localhost:5000
    • git_credentials: Your GitHub, GitLab, etc., credentials. Used for authentication when pushing images directly from git remote repositories.
      • username: Your username
      • access_token: Your access token or password
  • testconnection

    Tests if the application can connect to the configured registry url.

    $ docker-registry-cli testconnection

GUI

To enter a gui-like mode run:

$ docker-registry-cli gui
  • Lists repositories in the registry.

    Demo:

  • Pushes a new image into the registry.

    Demos:

    From local built image:

    From dockerfile:

    From a git repository:

  • Removes or untags an image from the registry.

    Demos:

    Only the specified tag:

    The specified tag and all related tags:

  • Shows a prompt for editing the application's configuration

    Fields:

    • registry_url: The url where the registry is located at. E.g.: http://localhost:5000
    • git_credentials: Your GitHub, GitLab, etc., credentials. Used for authentication when pushing images directly from git remote repositories.
      • username: Your username
      • access_token: Your access token or password

    Demo:

  • Tests if the application can connect to the configured registry url.

    Demo:

Project Status

Project is: in progress

Room for Improvement

Room for improvement:

  • Application could be improved by reducing dependence on the docker engine

To do:

  • Add "No GUI" commands
  • Add Minimal GUI mode
  • Add tests

Credits