docmir v0.6.5
docmir
A CLI application to create and sync images from dockerhub to provider of choice. Currently, only supports (AWS ECR)
Usage
$ npm install -g docmir
$ docmir COMMAND
running command...
$ docmir (-v|--version|version)
docmir/0.6.5 darwin-x64 node-v16.2.0
$ docmir --help [COMMAND]
USAGE
$ docmir COMMAND
...
Commands
docmir auth [PROVIDER]
docmir create-repo PROVIDER REPONAME
docmir create-sync PROVIDER REPONAME TAG
docmir help [COMMAND]
docmir pull [IMAGE] [TAG]
docmir push PROVIDER IMAGE REPOURL TAG
docmir search-tags IMAGENAME [PROVIDER]
docmir sync REPO PROVIDER
docmir auth [PROVIDER]
Set Docker user and password, and validate credentials with provider
USAGE
$ docmir auth [PROVIDER]
ARGUMENTS
PROVIDER (ecr|docker) [default: docker] The registry provider
OPTIONS
-h, --help show CLI help
-p, --userPassword=userPassword docker password
-r, --repository=repository Repository url
-u, --userName=userName docker username
See code: src/commands/auth.ts
docmir create-repo PROVIDER REPONAME
Create a repo for the provider
USAGE
$ docmir create-repo PROVIDER REPONAME
ARGUMENTS
PROVIDER (ecr|docker) The registry provider to create the repo
REPONAME Name you want the repo to be called. By defualt syncs are created with the name of the image
OPTIONS
-h, --help show CLI help
See code: src/commands/create-repo.ts
docmir create-sync PROVIDER REPONAME TAG
This command creates a sync with a provider. It stores everything to local file for future syncs
USAGE
$ docmir create-sync PROVIDER REPONAME TAG
ARGUMENTS
PROVIDER (ecr|docker) The registry provider
REPONAME Name of the docker repo you want to sync
TAG The tag you want to sync
OPTIONS
-h, --help show CLI help
See code: src/commands/create-sync.ts
docmir help [COMMAND]
display help for docmir
USAGE
$ docmir help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
docmir pull [IMAGE] [TAG]
Will pull an image from docker hub directly to local machine
USAGE
$ docmir pull [IMAGE] [TAG]
ARGUMENTS
IMAGE Image to pull from dockerhub
TAG Tag to pull from dockerhub. Defaults to latest if not used
OPTIONS
-h, --help Help command
See code: src/commands/pull.ts
docmir push PROVIDER IMAGE REPOURL TAG
Push an Image with tag to provider registry
USAGE
$ docmir push PROVIDER IMAGE REPOURL TAG
ARGUMENTS
PROVIDER (ecr|docker) The provider you will push images to
IMAGE
REPOURL
TAG
OPTIONS
-h, --help show CLI help
See code: src/commands/push.ts
docmir search-tags IMAGENAME [PROVIDER]
Searches dockerhub for available images of the docker registry
USAGE
$ docmir search-tags IMAGENAME [PROVIDER]
ARGUMENTS
IMAGENAME Image you want to get tags from
PROVIDER (ecr|docker) [default: docker] The registry provider to search.
OPTIONS
-h, --help show CLI help
See code: src/commands/search-tags.ts
docmir sync REPO PROVIDER
Syncs all tags missing in target registry.
USAGE
$ docmir sync REPO PROVIDER
OPTIONS
-h, --help show CLI help
DESCRIPTION
Note: you must create a sync first before syncing the entire repo at this point. This is best used for when you want
to keep a sync up to date
See code: src/commands/sync.ts
Provider Setup
Docker
In order to take advantage of being able to pull and push images without hitting rate limmite, its best to be logged in with a user.
Use the auth
command to set the user.
ECR
To use the AWS ecr provider you need to set the aws environment variables in order to authenticate. The following env variables need to be set:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_ACCOUNT_ID
Future
- Update search tags functionality to specify a list of tags based on version and wild card.
- 1.2.* returns all patches
- Update search tags to find tags across multiple repositories. (mulitple repo's with name busybox)
- update sync functionality to sync based off limited search tag functionality
- add providers azurecr.io, jfrog, quay.io, gcr.io, private dockerhub
- multiprovider support
- ability to set provider globally