Beispiel #1
0
def raise_if_client_version_is_less_than_1_9_1():
    docker_client_version = client_version()
    if docker_client_version < parse_version('1.9.1'):
        raise DockerVersionError(
            """Your local host has Docker client version {client_version}.
When you run a Multicontainer Docker application locally, the EB CLI requires Docker client version 1.9.1 or later.
Find the latest Docker client version for your operating system here: https://www.docker.com/community-edition
""".format(client_version=str(docker_client_version)))
Beispiel #2
0
def __process_version(string):
    version = string.decode().strip().replace("'", "").replace('-ce', '')

    if not version:
        raise DockerVersionError(
            """Couldn't connect to Docker daemon - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
""")

    return parse_version(version)
Beispiel #3
0
def raise_if_docker_py_and_an_incorrect_version_of_docker_exist():
    docker_py_package = get_package('docker-py')
    docker_package = get_package('docker')
    if docker_py_package and docker_package and not docker_version_is_2_6_x():
        message = os.linesep.join([
            "Your local host has the 'docker-py' version {docker_py_version} and 'docker' version {docker_version} Python packages installed on it."
            .format(docker_py_version=docker_py_package.version,
                    docker_version=docker_package.version),
            "When you run a Multicontainer Docker application locally, these two packages are in conflict. The EB CLI also requires a different version of 'docker'.",
            "", "To fix this error:",
            "Be sure that no applications on your local host requires 'docker-py', and that no applications need this specific version of 'docker', and then run these commands:",
            "   pip uninstall docker-py", "   pip install 'docker>=2.6.0,<2.7'"
        ])

        raise DockerVersionError(message)
Beispiel #4
0
def raise_if_docker_py_and_docker_exist():
    docker_py_package = get_package('docker-py')
    docker_package = get_package('docker')
    if docker_py_package and docker_package:
        message = os.linesep.join([
            "Your local host has the 'docker-py' version {docker_py_version} and 'docker' version {docker_version} Python packages installed on it."
            .format(docker_py_version=docker_py_package.version,
                    docker_version=docker_package.version),
            "When you run a Multicontainer Docker application locally using the EB CLI, these two packages are in conflict.",
            "", "To fix this error:",
            "Be sure that no applications on your local host require 'docker-py', and then run this command:",
            "   pip uninstall docker-py"
        ])

        raise DockerVersionError(message)
Beispiel #5
0
def raise_if_docker_py_exists_but_not_docker():
    docker_py_package = get_package('docker-py')
    docker_package = get_package('docker')
    if docker_py_package and not docker_package:
        message = os.linesep.join([
            "Your local host has the 'docker-py' version {docker_py_version} Python package installed on it."
            .format(docker_py_version=docker_py_package.version),
            "When you run a Multicontainer Docker application locally, the EB CLI requires the 'docker' Python package.",
            "", "To fix this error:",
            "Be sure that no applications on your local host require 'docker-py', and then run this command:",
            "   pip uninstall docker-py", "",
            "The EB CLI will install 'docker' the next time you run it."
        ])

        raise DockerVersionError(message)
from __future__ import unicode_literals
from pkg_resources import DistributionNotFound
from setuptools.command import easy_install

from ebcli.bundled._compose.service import Service
from ebcli.objects.exceptions import DockerVersionError

try:
    if easy_install.get_distribution('docker-py'):
        raise DockerVersionError(
            """Your local host has the 'docker-py' Python package installed on it.

When you run a Multicontainer Docker application locally, the EB CLI requires the 'docker' Python package.

To fix this error:

Be sure that no applications on your local host require 'docker-py', and then run this command:"
	pip uninstall docker-py""")
except DistributionNotFound:
    pass

__version__ = '1.3.0dev'