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 config set-registry posen
Set [DEFAULT] registry = posen

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

# Add images/myFirstImage/ to the configuration
$ dock image config set images/myFirstImage/
Set [images/myFirstImage] image-file = Dockerfile
Set [images/myFirstImage] type = image
images/myFirstImage:
- registry: posen
- image-file: Dockerfile
- image-name:
- depends-on:
- type: image

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

# Add charts/myFirstChart/ to the configuration
$ dock chart config set charts/myFirstChart/
Set [charts/myFirstChart] type = chart
charts/myFirstChart:
- oci-registry: oci://registry-1.docker.io/posen
- type: chart

# Add charts/mySecondChart/ to the configuration
$ dock chart config set charts/mySecondChart/
Set [charts/mySecondChart] type = chart
charts/mySecondChart:
- oci-registry: oci://registry-1.docker.io/posen
- 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]
image-file = Dockerfile
type = image

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

[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
    

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.0.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

dock_cli-1.0.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dock_cli-1.0.1.tar.gz
  • Upload date:
  • Size: 8.4 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.0.1.tar.gz
Algorithm Hash digest
SHA256 1aca6fb038f925bca7b17096ae75a6f02ac0b638fef85af736ad91c0fd640215
MD5 e4fa93b401a5d3e7747c9312b12fc7a7
BLAKE2b-256 ab1525424dfd0d5f1ff103c997207406048ea2d82c64563b6287007e6a84128a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dock_cli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b437ec7992a03643ef9911d23c75ade7d98ea7995532c4f9369dc2013a25496
MD5 2d6d2587f4b17f0a8de505c1ba232877
BLAKE2b-256 b3d5f9701e1ea05bff9317cb67f6b5bedd2dedb91b94af10971e321707f1d38a

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