Skip to main content

CLI for manage container applications

Project description

Dock CLI

CLI tool for managing containerized applications in a Git repository.

It allows you to implement automatic version control for Docker images and Helm charts in a quick and easy way.

Installation

Install and update using pip.

$ pip install -U dock-cli

Getting Started

Assuming you have a repository with multiple Docker images and Helm charts that require automatic version control.

For example, the folder structure of your repository is as follows:

<repository_root>/
 | - .git/
 | - charts/
 | | - myFirstChart/
 | | | - Chart.yaml
 | | - mySecondChart/
 | | | - Chart.yaml
 | - images/
 | | - myFirstImage/
 | | | - Dockerfile
 | | - mySecondImage/
 | | | - Dockerfile
 | - dock.ini

Where dock.ini can be empty or nonexistent, you can use the following command to update dock.ini:

# Set default registry for all images
$ dock image set-registry posen -y
  Set [DEFAULT] registry = posen

# Set default registry for all charts
$ dock chart set-registry oci://registry-1.docker.io/posen -y
  Set [DEFAULT] oci-registry = oci://registry-1.docker.io/posen

# Add images/myFirstImage/ to the configuration
$ dock image set images/myFirstImage/ -y
  Set [images/myFirstImage]
  Set [images/myFirstImage] type = image
  Set [images/myFirstImage] image-file = Dockerfile
  Unset [images/myFirstImage] image-name
  Unset [images/myFirstImage] depends-on

# Add images/mySecondImage/ to the configuration
$ dock image set images/mySecondImage/ --depends-on=images/myFirstImage/ -y
  Set [images/mySecondImage]
  Set [images/mySecondImage] type = image
  Set [images/mySecondImage] image-file = Dockerfile
  Unset [images/mySecondImage] image-name
  Set [images/mySecondImage] depends-on = images/myFirstImage

# Add charts/myFirstChart/ to the configuration
$ dock chart set charts/myFirstChart/ -y
  Set [charts/myFirstChart]
  Set [charts/myFirstChart] type = chart

# Add charts/mySecondChart/ to the configuration
$ dock chart set charts/mySecondChart/ -y
  Set [charts/mySecondChart]
  Set [charts/mySecondChart] type = chart

And the content of dock.ini is as follows:

$ cat dock.ini
[DEFAULT]
registry = posen
oci-registry = oci://registry-1.docker.io/posen

[images/myFirstImage]
type = image
image-file = Dockerfile

[images/mySecondImage]
type = image
image-file = Dockerfile
depends-on = images/myFirstImage

[charts/myFirstChart]
type = chart

[charts/mySecondChart]
type = chart

Then you can use the following command to push to the registry:

  • List all images and charts
    $ dock image list
    images/myFirstImage
    images/mySecondImage
    $ dock chart list
    charts/myFirstChart
    charts/mySecondChart
    
  • Build all images and Package all charts
    $ dock image list | xargs -r dock image build
    $ dock chart list | xargs -r dock chart package
    
  • Push all images and charts
    $ dock image list | xargs -r dock image push
    $ dock chart list | xargs -r dock chart push
    

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dock_cli-1.2.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

dock_cli-1.2.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file dock_cli-1.2.0.tar.gz.

File metadata

  • Download URL: dock_cli-1.2.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.14

File hashes

Hashes for dock_cli-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0b45efd1db20842a77430e7ad3e157444db97d03a4b65ce691744aa466745382
MD5 a59cf6d7f9b03fbf0cab677bd183c772
BLAKE2b-256 ce5f4ae16823d8ce385ebcd6efb985e74e31b758060f3a1e4e2b06b0f2b0b0ae

See more details on using hashes here.

File details

Details for the file dock_cli-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: dock_cli-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.14

File hashes

Hashes for dock_cli-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f39e7716911ee7406bca3eee774234d759c05b4eb190b78a3202bb1f9db0c7b0
MD5 341cbea9ca4285875cdc206c532c1b47
BLAKE2b-256 b984d414a2c9eefb3438331af3ad9baeddca870681f33ab3f7bfc402ff9239e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page