{ "info": { "author": "Usman Shahid", "author_email": "u.manshahid@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# Dove\n### A docker versioning extension\n\nHave the static tagging mechanism of docker bugged you and prevented you from creating flawless and incrementally versioned CD/CI of docker images? Well then you may like this tool. \n\n### What it does?\n\nYou keep a docker tag template and a version in a configuration file and you use this toolkit, which can automatically increment the version stored in the configuration file when building and tagging the image, and automatically pick the full tag when saving and deploying the image. How does it help? Well you combine it with git and you got yourself a flawless CD/CI without any hardcoded tags.\n\n## Installation\n\nYou'd need docker(duh), python3 and pip3 (for python3). Simply clone the repository and do a\n```\nsudo -H pip install ./\n```\ninside the cloned repository.\n\n## Usage\n\nLike docker, it's a command-line tool. Do a `dove` on the shell to display all the help.\n\n```\nUsage: dove [OPTIONS] COMMAND [ARGS]...\n\n A docker versioning extension that manages docker tags through a JSON\n file, so that the user doesn't have to get into the hassle of writing and\n updating image tags.\n\n Maintained by: Intech A&I\n\n For more info, visit:\n\n https://github.com/intech-iiot/dove\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n build Build the docker image with saved tag\n bump Just bump up the current version\n get Get the current tag from the config\n new Initialize a new dove config\n push Push the image with tag saved in the config\n reset Reset the version at position(s) to 0\n save Save an image with the tag from the config\n tag Tag another image with the saved tag\n\n```\n\n## Create new config\n\nThe tool requires a `dove.json` configuration file to be placed with the Dockerfile. This file can be created by executing the following on shell:\n\n```\ndove new -t my-repo/my-image:{0}.{1}.{2} -i 3.2.1\n```\n\nThe `-t` puts a tag template with string positional parameters and the `-i` puts an initial version for the image.\n\n## View current tag\n\nAfter creating the configuration file, run the following in the directory with rhe configuration file:\n\n```\ndove get\n```\n\nThis will show `my-repo/my-image:3.2.1` for the above configuration. Evidently, the version is split using a dot(.) and the components are substituted on the positional parameters. Ofcourse you can use the tag in other commands such as: \n\n```\ndocker image inspect $(dove get)\n```\n\n\n## Building the image with current tag\n\nFor this, a dockerfile must be present with the dove configuration. Do a:\n\n```\ndove build\n```\n\nThis will start building the docker image with the current tag from the configuration file. To bump up the version, do a:\n\n```\ndove build --bump 0\n```\n\nThis will increment the portion of the version that is supposed to replace the positional parameter at {0}. Similarly, to bump up multiple portions, do a:\n\n```\ndove build --bump 0 --bump 1\n```\n\n## Just bumping up the tag\n\nif you're inclined to use the docker cli commands yourself, you can still use the configuration and its version bumping features by bumping the version manually. To do so, do a:\n\n```\ndove bump --position 0\n```\n\nThis will update the version in the configuration and return the bumped up tag in the stdout, which can be nested in a docker command itself e.g.\n\n```\ndocker build -t $(dove bump --position 0) ./\n```\n\nor you can simply get the tag afterwards\n\n```\ndocker build -t $(dove get) ./\n```\n\n## Reseting version in tag\n\nYou can also reset the version number at any position by:\n\n```\ndove reset --position 0\n```\n\nThis will reset the version number at position 0, which is useful if you follow a major-minor release cycle since a major release bump means a reset of the minor release version to 0.\n\n## Tagging an existing image\n\nAn existing image can be tagged with a dove configuration. To do so, do a:\n\n```\ndove tag -s source-image-tag\n```\n\nThe source-image will be tagged with the tag inferred from the configuration file in the current context\n\n## Saving the image\n\nTo save the image with the inferred tag from the configuration, do a:\n\n```\ndove save -f filename\n```\n\n## Pushing the image\n\nIf the tag format contained a remote repo, I also have implemented a push function. To do so, simply do a:\n\n```\ndove push\n```\n\n## Docker arguments\n\nThe `dove build` and `dove push` commands can be provided with `docker build` and `docker push` command-line arguments through the `--args` or `-a` argument. For example:\n\n```\ndove build -a --pull\n```\n\nor \n\n```\ndove build -a --pull -a --no-cache -a --label=pickle-rick\n```\n\nYeah I know, it's pretty repetitive, and you can only use the long version with `=`, but I didn't know any other way of separating the dove and docker command line args. At least it's better than nothing.\n\n## Alternate Tag Formats\n\nFrom version 0.0.3 onwards commands and parameters for maintaining alternate tag formats was introduced. What this means is that the `dove.json` can contain more than one tag format in which the version is substituted. This is done by keeping a primary tag format and maintaining a name-value pair of alternate tag formats. These tags can be used in the other commands by means of a `-l` or `--alt` flag. This is very useful for multi-stage builds. You can have a different tag with the same version for different builds by using this.\n\n### Adding a new alternate tag format\n\nTo add a new alternate tag to the existing `dove.json` configuration, do a:\n\n```\ndove add-alt -l my-alt-tag my-repo/my-image:{0}.{1}.{2}\n```\n\n### Viewing all the alternates\n\nTo view the alternates that were added to the configuration file, do a: \n\n```\ndove alts\n```\n\n### Removing an alternate tag format\n\nAn alternate can be removed through it's name by doing a:\n\n```\ndove remove-alt -n my-alt-tag\n```\n\n### Using alternate tags in the other commands\n\nAny command that uses tags from the configuration file has an existing flag `-l` or `--alt` which is used to specify the name of the alternate you itend to use. For example, to build an image with an alternate tag, do a: \n\n```\ndove build -l my-alt-tag\n```\n\n## Contributing\n\nI'm strictly not a python programmer and really did it as a side project so I can make some pretty streamlined CD/CI. I'd really appreciate if you want to contribute to this little utility of mine.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/intech-iiot/dove", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "dove-docker", "package_url": "https://pypi.org/project/dove-docker/", "platform": "", "project_url": "https://pypi.org/project/dove-docker/", "project_urls": { "Homepage": "https://github.com/intech-iiot/dove" }, "release_url": "https://pypi.org/project/dove-docker/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "A tool to extend the docker functionality to include an incremental tag versioning system for docker images", "version": "0.0.4" }, "last_serial": 4584497, "releases": { "0.0.4": [ { "comment_text": "", "digests": { "md5": "8d0f3f8e12191f43ee594b8e257f3e35", "sha256": "99d0fc298b675d13685a92fcee03f65b734ca9d620b406300fa4a3c346609cf0" }, "downloads": -1, "filename": "dove-docker-0.0.4.tar.gz", "has_sig": false, "md5_digest": "8d0f3f8e12191f43ee594b8e257f3e35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6171, "upload_time": "2018-12-11T09:21:21", "url": "https://files.pythonhosted.org/packages/8f/9a/e1f1b6694ff1db1cd6ca8265a30d30812aac7afc39705b95beac20e291df/dove-docker-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8d0f3f8e12191f43ee594b8e257f3e35", "sha256": "99d0fc298b675d13685a92fcee03f65b734ca9d620b406300fa4a3c346609cf0" }, "downloads": -1, "filename": "dove-docker-0.0.4.tar.gz", "has_sig": false, "md5_digest": "8d0f3f8e12191f43ee594b8e257f3e35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6171, "upload_time": "2018-12-11T09:21:21", "url": "https://files.pythonhosted.org/packages/8f/9a/e1f1b6694ff1db1cd6ca8265a30d30812aac7afc39705b95beac20e291df/dove-docker-0.0.4.tar.gz" } ] }