Package: docker-compose-swarm-mode
Docker Compose for Swarm Mode=============================Drop in replacement for docker-compose that works with swarm modeintroduced in Docker 1.12 (and converter to Kubernetes format).Motivation----------Docker 1.12 with its new `Swarmmode <https://docs.docker.com/engine/swarm/>`__ has been out for awhile, but Docker Compose - the great tool for running multi-containerconfigurations - still (1.5+ months after Docker release) doesn'tsupport it.The only thing they offer is generating a`DAB <https://github.com/docker/docker/blob/master/experimental/docker-stacks-and-bundles.md>`__file from your ``docker-compose.yml`` and deploying it to Docker.However DAB doesn't support a lot of ``docker-compose.yml`` stuff anddeploying it to Docker is an experimental feature that is not supportedyet in the latest 1.12.1 release.So you should either stick with the previous version of Docker or throwout all your docker-compose files and run a bunch of long``docker service ...`` commands.Neither option looked good to me so, as a temporary solution (I stillhope Docker Compose with swarm mode support will be released soon), I'vecreated a script that parses a ``docker-compose.yml`` file, generates``docker service ...`` commands for you and runs them.UPDATE^^^^^^After some stability and network issues with Docker swarm mode we'vedecided to try our luck with Kubernetes.Several existing compose-to-kubernetes translation tools have failed onour compose files, so I decided to quick add such functionality todocker-compose-swarm-mode.Installation------------docker-compose-swarm-mode is available on`PyPI <https://pypi.python.org/pypi/docker-compose-swarm-mode>`__.``pip install docker-compose-swarm-mode``Or just download the ``.py`` script.Or use Docker image`ddrozdov/docker-compose-swarm-mode <https://hub.docker.com/r/ddrozdov/docker-compose-swarm-mode/>`__,e.g.:::docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -v /some/dir/with/compose/files:/compose ddrozdov/docker-compose-swarm-mode -f /compose/docker-compose.yml --dry-run upRequirements------------Python 2.7+.Usage-----The script tries its best to support the CLI of the original DockerCompose so just use it as you would use Docker Compose.Use ``--dry-run`` option if you'd first like to check what ``docker``commands are to be executed.The script currently doesn't support all docker-compose commands,options, and ``yml`` keys. It just supports what I've needed in myprojects so far. See the usage help with ``-h`` flag and try the scriptwith your ``docker-compose.yml``, it'll tell you if there areunsupported keys.In case you need something that is not supported yet, feel free tocreate an issue and/or submit a pull request.Keys that are silently ignored because they are not supported by``docker service``: \* container\_name \* expose \* extra\_hosts \*hostnameConvert to Kubernetes format (since 2.0.0)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The script can also be used to convert compose files to Kubernetesresource specifications:::docker-compose-swarm-mode -f docker-compose.yml -p project convert > kubernetes.ymlCurrently only the things under top-level ``services`` key areconverted.For each compose's service one Kubernetes Service and one Deployment aregenerated.Support for some keys is not yet implemented (see TODOs in the code).Keys that are silently ignored because they are not supported byKubernetes: \* extra\_hosts \* hostname \* logging \* networksHistory-------2.1.0^^^^^Support for volume ``driver`` key.Support for ``env_file`` key.Some ``convert`` related fixes.Support for dictionary format in ``labels`` key.Fix ``bash`` missing in Docker image.Shell quoting fixes.2.0.0^^^^^New operation ``convert`` to translate compose files to Kubernetesformat.1.4.0^^^^^Support for ``mode`` key.Use "json-file" as a default for ``logging.driver``.Partial support for ``labels`` key (array format only).Extended services merging fixes and improvements.Fix Python 3 compatibility.1.3.0^^^^^Support empty project name (resolves #24).Merge lists and dictionaries for extended services.1.2.2^^^^^Hotfix for stop & rm commands.1.2.1^^^^^Fix service detection (fixes #21 and #23).Fix typo in volume detection.1.2.0^^^^^Fix services, networks, and volumes being incorrectly detected asexisting/running in some cases.Fix spaces handling in variables under ``environment`` key.Support for multiple compose files.Support for ``.env`` file.1.1.1^^^^^Fix pypandoc being required on installation while needed on packagingphase only.1.1.0^^^^^Python 3 support.Installation from PyPI.1.0.0^^^^^First release.License-------The MIT License (MIT)Copyright (c) 2016 Dmitry DrozdovPermission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.