GithubHelp home page GithubHelp logo

bradleya / search-docker-registry-v2-script.1.0 Goto Github PK

View Code? Open in Web Editor NEW
50.0 5.0 16.0 472 KB

view-private-registry is a simple bash script for listing images in a private registry v2, docker search registry-v2

License: MIT License

Shell 100.00%
registry docker-search-registry bash-script docker-image docker-registry docker shell-script shellscript registry-scripts linux

search-docker-registry-v2-script.1.0's Introduction

Search-docker-registry-v2-script

GitHub Stable Release GitHub Release Date GitHub Commits Since GitHub Last Commits

Open GitHub Issue GitHub Open Issues GitHub Closed Issues GitHub pull requests GitHub pull requests

GitHub Repo Clones GitHub Repo Views GitHub Size Language Bash MIT License

Goal

List images on docker registry v2

If you like this repository, select in the upper-right corner, GitHub stars, thank you.

Table of content

Table of content



Descriptions

view-private-registry is a bash script for listing images in a private registry v2. It does not require registry v2 to be running on the system, only the filesystem where the images are stored. Docker search registry v2 functionality is currently not supported at the time of this writing. See discussion since Feb 2015: "propose registry search functionality #206" distribution/distribution#206

view-private-registry-remote is a bash script for listing images in a private registry v2 from a remote system that does not have the NFS filesystem mounted where the images are stored. This script requires ssh to be installed and configured on the systems required to run this script. This script calls the view-private-registry script that is on the host with the NFS filesystem mounted.

Return to top

Install

To Install, change into a directory that you want to download the scripts. Use git to pull or clone these scripts into the directory. If you do not have Git installed then enter; "sudo apt-get install git" if using Debian/Ubuntu. Other Linux distribution install methods can be found here: https://git-scm.com/download/linux. On the GitHub page of this script use the "HTTPS clone URL" with the 'git clone' command.

git clone https://github.com/BradleyA/Search-docker-registry-v2-script
cd Search-docker-registry-v2-script

Edit view-private-registry script, change PERSISTENT_REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY to the path to your registry storage filesystem root directry. It is the volume you used when starting the registry for /var/lib/registry.

 PERSISTENT_REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY="<your registry storage filesystem root directry>"

Move the script or create a symbolic link to a location in your working path; example /usr/local/bin. To find directories in your working path use; "echo $PATH".

cp view-private-registry ..
cd ..
sudo ln -s $PWD/view-private-registry /usr/local/bin/view-private-registry

Edit view-private-registry-remote script, change REMOTE_REGISTRY_HOST to the remote host that has the registry v2 mounted, change REMOTE_ADMIN_ACCOUNT to the ssh admin account on the REMOTE_REGISTRY_HOST.

 REMOTE_REGISTRY_HOST="<server IP address or FQDN>"
 REMOTE_ADMIN_ACCOUNT="<ssh admin account for the above host>"

Move the script or create a symbolic link to a location in your working path (see example above).

Return to top

Usage

view-private-registry

or

view-private-registry-remote

Return to top

Output

$ view-private-registry
busybox:latest
gcr.io/google_containers/etcd:2.0.9
gcr.io/google_containers/hyperkube:v0.21.2
gcr.io/google_containers/pause:0.8.0
google/cadvisor:latest
jenkins:latest
logstash:latest
mongo:latest
nginx:latest
python:2.7
redis:latest
registry:2.1.1
stackengine/controller:latest
tomcat:7
tomcat:latest
ubuntu:14.04.2
Number of images:   16
Disk space used:    1.7G    /mnt/three/docker-registry/registry-data

Return to top

TLS

I wrote a few scripts that may help you with the private registry and TLS. The scripts are create-registry-tls.sh, copy-registry-tls.sh, and check-registry-tls.sh which can be found in https://github.com/BradleyA/docker-security-infrastructure/blob/master/docker-TLS/README.md. These scripts support --help and --usage options to reduce the learning curve.

Return to top


Contribute

Please do contribute! Issues, comments, and pull requests are welcome. Thank you for your help improving software.

Return to top

Author

Follow @bradleyaustintx GitHub followers

Return to top

Stars

Stargazers repo roster for @BradleyA/Search-docker-registry-v2-script.1.0

Return to top

Forks

Forkers repo roster for @BradleyA/Search-docker-registry-v2-script.1.0

Return to top

Tested OS

  • CoreOS 723.3.0
  • Raspbian GNU/Linux 10 (buster)
  • Ubuntu 14.04.3 LTS (amd64,armv7l)
  • Ubuntu 16.04.7 LTS (amd64,armv7l)
  • Ubuntu 18.04.5 LTS (amd64,armv7l)

Return to top

Design Principles

  • Have a simple setup process and a minimal learning curve
  • Be usable as non-root
  • Be easy to install and configure

Return to top

License

MIT License

Copyright (c) 2021 Bradley Allen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Return to top

search-docker-registry-v2-script.1.0's People

Contributors

bneradt avatar bradleya avatar cptx86 avatar tdluk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

search-docker-registry-v2-script.1.0's Issues

Support more than one private registry:v2 on the same host

To support more than one private registry:v2 on the same host requires each registry to use a different port number ($REGISTRY_PORT). The $REGISTRY_PORT number will be used in the directory path name that stores the images for each private registry. By using the port number in the directory path, each registry path will be different. Each registry can store its' certification keys in the directory /usr/local/docker-registry-$REGISTRY_PORT/registry-certs.

Support PERSISTENT_REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY as an environment variable that may or may not be defined by a user to a file system root directory to store images (example: /usr/local, default if not defined /usr/local). Images will be stored in the following directory: $PERSISTENT_REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY"/docker-registry-$REGISTRY_PORT/docker

Support two command line arguments:
ARG1=Private registry port number (default 5000)
ARG2=Search private registry for ARG2 (example: prod, dev, tag-name, date, or anything, default none)

example usage:
Search default registry in /usr/local with default port 5000. $REGISTRY_PORT and $PERSISTENT_REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY are not defined
view-private-registry
Search default registry in /usr/local with non-default port defined at 17313 in environment variable $REGISTRY_PORT
REGISTRY_PORT=17313
view-private-registry

Change script name to docker-search so it is closer to the comand

Change script name to docker-search so when docker registry v2 search is working, I don't need to unlearn the format and it is easier to use and remember.
Example:
Usage: docker-search [OPTIONS] [IMAGE]

Search Private Docker Registry v2 for images

-h, --help=false Print usage
-r, --registry="dev"
dev (development) default
fvt (function verification test)
gvt (global verification test)
svt (security verification test)
plisp (performance/load/integration/stress/platform test)
prom (promote release)
prod (production)
roll (roll back staging)
hist (historic)
v2 (/var/lib/registry)

Update name of script and README file

Feature Request --> view-private-registry - change output order to latest version first

Tell us about your feature request:
A clear and concise description of what you want to happen or the change you would like to see. Use a use case to describe how a person would actually use your request to accomplish a goal. Thank you.

-> after adding pull request: Sort image tags by version instead of purely alphabetically #14
-> reversing the order by including -r so the latest version would be first, -Vr

Before pull request #14
$ ls -1 | sort
foo-1
foo-11
foo-111
foo-5
registry:2lv2019-04-07T15.56.40_CDT
registry:2lv2019-04-07T18.37.19_CDT
registry:2lv2019-04-07T18.41.25_CDT

After pull request #14
$ ls -1 | sort -V
foo-1
foo-5
foo-11
foo-111
registry:2lv2019-04-07T15.56.40_CDT
registry:2lv2019-04-07T18.37.19_CDT
registry:2lv2019-04-07T18.41.25_CDT

test feature request
$ ls -1 | sort -Vr
registry:2lv2019-04-07T18.41.25_CDT
registry:2lv2019-04-07T18.37.19_CDT
registry:2lv2019-04-07T15.56.40_CDT
foo-111
foo-11
foo-5
foo-1

Describe how your feature request could work:
Steps to demonstrate your feature request.

  1. Enter/Click on -> view-private-registry 17315

How are you currently working without your feature request?
A description of any alternative solutions or features you've considered or are using today.

-> N/A

Version:

  • OS ( lsb_release -a ; Ubuntu 14.04 Ubuntu 16.04 Ubuntu 20.04 )

    -> Ubuntu 16.04
    
  • Command: ( check-markit 4.1.4.803 2020-08-29T22:25:47.061044-05:00 (CDT) https://github.com/BradleyA/markit.git master uadmin )

    -> view-private-registry  V2.1.40  2019-02-18T22:40:30.213875-06:00 (CST)  https://github.com/BradleyA/Search-docker-registry-v2-script.git  uadmin
    

Add search for multiple private registries

These could be repositories inside one registry
Example of some other registries:

Usage: docker-search [OPTIONS] [IMAGE]

Search Private Docker Registry v2 for images

--help=false Print usage
-r, --registry="dev" dev (development) default
fvt (function verification test)
gvt (global verification test)
svt (security verification test)
plisp (performance/load/integration/stress/platform test)
prom (promote release)
prod (production)
roll (roll back staging)
hist (historic)
v2 (/var/lib/registry)

How to access remote Docker private registry

The script which you provide has to be executed in the host where docker registry is deployed.

Is there a way to access remote docker private registry on v2.

Api doesnt work for me

view-private-registry-remote - retest with new ARCHITECTURE

Need to determine if I need to update the design with the new ARCHITECTURE tree

This challenge, do I support the new cluster architecture enough to expend limited resources (time) to complete a rework on a working solutions or just explain that symbolic links will solve the differences in any architecture . . . Knowing all the while that these types of changes have additional unknown costs, because they will create other unknown challenges requiring more limited resources (time) to complete the rework (risk). This makes it very difficult to determine the cost of the rework. And using symbolic links will create confusion (risk) during operations when incidents occur. Creating unplanned work . . . at some future unknown time . . . at some future unknown cost . . . requiring an unknown amount of time

Technical debt is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy solution now instead of using a better approach that would take longer. Technical debt can be compared to monetary debt. Wikipedia

docker registry setup and IP SANs

Hi Bradley,

Pls excuse for opening a new issue unrelated to this repo. This was the only way to contact you.

Recently, I hit upon this IP SANs issue (distribution/distribution#948) and wanted to know few things. You have outlined what you did to get over this; however, am stumbled inspite of following the procedure.

Is there a way to contact you (mail or skype) to talk ?

/Ram

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.