项目作者: MarcosCela

项目描述 :
Docker Remote
高级语言: Go
项目地址: git://github.com/MarcosCela/dr.git
创建时间: 2019-01-19T18:29:02Z
项目社区:https://github.com/MarcosCela/dr

开源协议:MIT License

下载




LicenseBadge
CircleCI


Docker remote is a CLI that attempts to provide a fast and intuitive way
to interact with a remote docker registry.

It is heavily inspired in kubectl, and attempts to copy some concepts,
like the use of contexts, or different output formats.

Install

You can install dr in your system in 2 different ways:

You will also need a basic configuration file, so you can tell dr where to find
the repositories. To learn more about how to set up the configuration file, read
the configuration documentation, and it is greatly recommended to use the autocomplete files.

Autocomplete

You can enable shell autocomplete scripts (in fact, it is highly recommended!), read how here: autocomplete.

Usage

Once you have correctly downloaded and configured dr, you can start using it:

Lis existing images:

  1. $dr ls
  2. {
  3. "images": [
  4. {
  5. "name": "alpine"
  6. },
  7. {
  8. "name": "another/busy/subpath"
  9. },
  10. {
  11. "name": "busybox"
  12. },
  13. {
  14. "name": "busybox/another/subpath/testing"
  15. },
  16. {
  17. "name": "busybox/testing"
  18. },
  19. {
  20. "name": "busybox/testing"
  21. }
  22. ]
  23. }

Listing tags for a specific image:

  1. dr tags busybox/testing
  2. {
  3. "tags": [
  4. "latest",
  5. "mytag"
  6. ]
  7. }

Or getting information about a specific image and tag:

  1. dr manifest busybox:1.29
  2. {
  3. "compressedSize": "729.5 kB",
  4. "digest": "sha256:758ec7f3a1ee85f8f08399b55641bfb13e8c1109287ddc5e22b68c3d653152ee",
  5. "image": "busybox",
  6. "layers": 1,
  7. "repository": "localhost:5000",
  8. "tag": "1.29"
  9. }

You can also play with the flags to use different output formats:

  1. dr manifest busybox:1.29 --output plain
  2. repository: localhost:5000
  3. image: busybox
  4. name: "1.29"
  5. digest: sha256:758ec7f3a1ee85f8f08399b55641bfb13e8c1109287ddc5e22b68c3d653152ee
  6. layers: 1
  7. compressedSize: 729.5 kB
  1. dr ls --output yaml
  2. images:
  3. - name: alpine
  4. - name: another/busy/subpath
  5. - name: busybox
  6. - name: busybox/another/subpath/testing
  7. - name: busybox/testing
  8. - name: busybox/testing

Disclaimer

This is a personal project aimed at learning Golang, but perhaps it will
suit your needs, so feel free to use it, fork it or contribute as you please.