{"id":15020053,"url":"https://github.com/dipsas/dockerfeed","last_synced_at":"2025-10-24T22:32:00.538Z","repository":{"id":57423269,"uuid":"211859057","full_name":"DIPSAS/DockerFeed","owner":"DIPSAS","description":"Docker Feed is a simple and convenient tool for handling deployment of docker compose files to a Swarm environment. By convention, it locates all stacks to deploy on a JFrog feed with every stack following a docker-compose filename pattern of `docker-compose.\u003cSTACK_NAME\u003e.\u003cVERSION\u003e.yml`.","archived":false,"fork":false,"pushed_at":"2020-03-16T22:00:53.000Z","size":107,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T04:31:38.725Z","etag":null,"topics":["docker","docker-compose","docker-compose-files","docker-feed","jfrog-feed","stack-files","stacks","swarm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DIPSAS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-30T12:51:50.000Z","updated_at":"2020-04-29T08:24:24.000Z","dependencies_parsed_at":"2022-09-05T11:10:47.103Z","dependency_job_id":null,"html_url":"https://github.com/DIPSAS/DockerFeed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIPSAS%2FDockerFeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIPSAS%2FDockerFeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIPSAS%2FDockerFeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIPSAS%2FDockerFeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DIPSAS","download_url":"https://codeload.github.com/DIPSAS/DockerFeed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238043593,"owners_count":19407058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","docker-compose-files","docker-feed","jfrog-feed","stack-files","stacks","swarm"],"created_at":"2024-09-24T19:54:31.523Z","updated_at":"2025-10-24T22:31:54.705Z","avatar_url":"https://github.com/DIPSAS.png","language":"Python","readme":"# Docker Feed\n\n[![PyPI version](https://badge.fury.io/py/DockerFeed.svg)](https://badge.fury.io/py/DockerFeed)\n[![Build Status](https://travis-ci.com/DIPSAS/DockerFeed.svg?branch=master)](https://travis-ci.com/DIPSAS/DockerFeed)\n[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\nDocker Feed is a simple and convenient tool for handling deployment of docker compose files to a Swarm environment.\nBy convention, it locates all stacks to deploy on a [JFrog](https://jfrog.com/) feed with every stack following a docker-compose filename pattern of `docker-compose.stack-name.1.0.0.yml`, thus this filename convention:\n- `docker-compose.\u003cSTACK_NAME\u003e.\u003cVERSION\u003e.yml`\n- Note! The stack name can only contain alphabetic letters and `-`/`_` signs.\n\nAdditionally, the Swarm probably needs to initialize some infrastructure before any stacks are deployed. This is handled by defining a `swarm.management.yml` file with details about which `configs`, `secrets`, `volumes` or `networks` to create. By convention, the `DockerFeed` tool will automatically detect the `swarm.management.yml` file if it exists in the current folder.\nPlease have a look at the [SwarmManagement](https://github.com/DIPSAS/SwarmManagement) project to get more details, but following is an example on how the `swarm.management.yml` content could look like:\n\n```yaml\nnetworks:\n    \u003cnetwork_name\u003e: \n        encrypted: true\nconfigs:\n    \u003cconfig_name\u003e: \u003cconfig_file\u003e\nsecrets:\n    \u003csecret_name\u003e: \u003csecret_file\u003e\nvolumes:\n    \u003cvolume_name\u003e:\n        driver: local\nenv_files:\n    - \u003cenvironment_file\u003e\n```\n\nTo map which stacks fits with each other, we introduce the `docker-compose-module` artifact.\nThe `docker-compose-module` artifact follows a filename pattern of `docker-compose-module.module-name.1.0.0.yml`, thus this filename convention:\n- `docker-compose-module.\u003cMODULE_NAME\u003e.\u003cVERSION\u003e.yml`\n- Note! The module name can only contain alphabetic letters and `-`/`_` signs.\n\nThe `docker-compose-module` artifact is a yaml file with this type of content:\n```yaml\nmodules:\n  my_module:\n    run:\n      - batch\u003e=1.0.0\n    deploy:\n      - nginx\u003e=1.0.0\n```\n\nThe `run` section of the module is a list of stacks to run as batch processes before deploying the stacks in the `deploy` section.\n\nAn example on how to use DockerFeed is found in the [./Example](./Example) folder.\n\n## Install Or Upgrade\n- pip install --upgrade DockerFeed\n\n## Prerequisites\n- python3x\n- Docker:\n  - https://www.docker.com/get-docker\n\n## Usage\nThe Docker Feed tool is available as the command line tool `dockerf`.\nHandle the docker feed by adding any of the following commands with zero or more stacks to handle.\nPrefix any of the following actions with the `module` argument to handle `docker-compose-module` deployments.\n- `init` - Initialize Swarm.\n- `deploy` - Deploy stacks to Swarm.\n    - Adding no specific stacks to deploy will result in deploying all stacks.\n    - Example: `dockerf deploy first-stack second-stack\u003e=1.0.0 third-stack==1.2.3`\n    - Example with module deployment: `dockerf module deploy first-module second-module\u003e=1.0.0`\n- `rm`/`remove` - Remove stacks from Swarm.\n    - Adding no specific stacks to remove will result in removing all stacks.\n    - Example: `dockerf remove first-stack second-stack`\n- `ls/list` - List stacks on feed.\n    - Hint, add search criterias following `ls`, such as:\n    - `dockerf ls first-stack second-stack\u003e=1.0.0`\n- `prune` - Remove all stacks.\n- `pull` - Pull stacks from feed.\n- `push` - Push docker-compose files to feed.\n    - Example: `dockerf push docker-compose.first-stack.yml docker-compose.second-stack.yml`\n- `run` - Run stacks as batch processes.\n    - Logs from each process is stored in a `logs` folder in the working directory. \n- `verify` - Verify that the stacks are properly configured.\n    - Following requirements are possible to validate:\n        1. Add `--verify-image-digests` to verify that All images are tagged with an immutable [digest](https://success.docker.com/article/images-tagging-vs-digests).\n        2. Add `--verify-images` to verify that all images are labeled with following labels:\n            - org.opencontainers.image.created\n            - org.opencontainers.image.authors\n            - org.opencontainers.image.revision\n            - org.opencontainers.image.version\n            - org.opencontainers.image.documentation\n            - org.opencontainers.image.title\n        3. Additional validation checks are also possible to activate:\n            - `--verify-no-configs`\n            - `--verify-no-secrets`\n            - `--verify-no-volumes`\n            - `--verify-no-ports`\n- Optional arguments:\n  - `-s/--source` to specify feed source. Either uri to jfrog feed, or a local folder with stack files. Default is `https://artifacts/delivery-dev`.\n  - `-u/--user` to specify user credentials for jfrog as `user:password`.\n  - `-t/--token` to specify a token for jfrog.\n  - `--verify-uri` to verify the jfrog uri certificate.\n  - `-e/--env` with environment variables to expose as `envKey=envValue`:\n    - `dockerf deploy -e key1=variable1 key2=variable2`\n    - Alternatively, any present `.env` will be considered as a file with environment variables to expose.\n  - `-r/--read` with a list of files containing stacks to handle, thus each line in the file is the name of a stack to handle.\n    - `dockerf deploy -r stackList.txt stackList2.txt`\n  - `--output-folder` to specify a destination folder for pulling stack files with 'pull'. Default is `./output/`.\n  - `--ignored` followed by a list of stacks or modules to ignore.\n  - `--logs-folder` to specify folder for storing log files when executing batch processes with 'run'. Default is './logs'.\n  - `--no-logs` to drop storing log files when executing batch processes with 'run'.\n  - `--verify-stacks-on-deploy` to deploy only valid stacks.\n  - `--verify-image-digests` to validate that image digests are used.\n  - `--verify-images` to validate required labels on images.\n  - `--verify-no-configs` to validate that no Swarm configs are used in stack.\n  - `--verify-no-secrets` to validate that no Swarm secrets are used in stack.\n  - `--verify-no-volumes` to validate that no Swarm volumes are used in stack.\n  - `--verify-no-ports` to validate that no ports are exposed in stack.\n  - `-i/--infrastructure` to specify the path to swarm.management.yml files for creating the Swarm infrastructure.\n  - `-c/--cache` to specify the cache folder to use for local cache storage of files. \n  - `-said/--stack-artifact-identifier` to specify stack artifact identifier. Default is `docker-compose.`.\n  - `-maid/--module-artifact-identifier` to specify module artifact identifier. Default is `docker-compose-module.`.\n  - `-h/--help` for help:\n    - `dockerf -h`\n\n## DockerFeed In Docker\nThe [dipsas/dockerfeed](https://hub.docker.com/repository/docker/dipsas/dockerfeed) image includes [DockerFeed](https://github.com/DIPSAS/DockerFeed) binaries, and makes it possible to push and verify docker-compose charts inside of a container.\n\nAdditionally, it is possible to push regular [Helm](https://helm.sh/) charts to a helm repository.\n\n## Example\n### Push docker-compose chart:\n```\ndocker run -it -v C:/MyLocalDirectoryTo/charts/:/charts -w /charts dipsas/dockerfeed push docker-compose.stack-name.1.0.0.yml --source https://artifacts/docker-compose-feed\n```\n\n### Push helm chart:\n```\ndocker run -it -v C:/MyLocalDirectoryTo/charts/:/charts -w /charts dipsas/dockerfeed push my-helm-chart-1.0.0.tgz --source https://artifacts/helm-feed\n```\n\n## Development\n\n### Dependencies:\n  - `pip install twine`\n  - `pip install wheel`\n  - `pip install -r requirements.txt`\n\n### Publish New Version.\n1. Configure [CHANGELOG.md](./CHANGELOG.md) with new version.\n3. Build: python setup.py bdist_wheel\n4. Check: twine check dist/*\n5. Publish: twine upload dist/*\n\n### Run Unit Tests\n- python -m unittest","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipsas%2Fdockerfeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdipsas%2Fdockerfeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipsas%2Fdockerfeed/lists"}