1.5.0 • Published 8 months ago

@lobatolobato/docker-registry-cli v1.5.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

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:

    npm.io

  • Pushes a new image into the registry.

    Demos:

    From local built image:

    npm.io

    From dockerfile:

    npm.io

    From a git repository:

    npm.io

  • Removes or untags an image from the registry.

    Demos:

    Only the specified tag:

    npm.io

    The specified tag and all related tags:

    npm.io

  • 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:

    npm.io

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

    Demo:

    npm.io

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

1.5.0

8 months ago

1.4.1

8 months ago

1.4.0

8 months ago

1.3.3

8 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.2.2

8 months ago

1.2.12

9 months ago

1.2.11

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.2

9 months ago

1.0.0

9 months ago