docker-archive/docker-snap

Docker compose failed to run when reading content from pipe

adglkh opened this issue · 0 comments

When running the automated tests, I noticed the following test case failed.

#!/bin/sh
set -e
yml=$(cat <<EOF
  test:
    image: ubuntu
    command: bash
    tty: true
EOF
)
echo "$yml" | docker.compose -f - up -d

Output:

Traceback (most recent call last):
  File "/snap/docker/102/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.12.0', 'console_scripts', 'docker-compose')()
  File "/snap/docker/102/lib/python2.7/site-packages/compose/cli/main.py", line 67, in main
    command()
  File "/snap/docker/102/lib/python2.7/site-packages/compose/cli/main.py", line 114, in perform_command
    project = project_from_options('.', options)
  File "/snap/docker/102/lib/python2.7/site-packages/compose/cli/command.py", line 37, in project_from_options
    override_dir=options.get('--project-directory'),
  File "/snap/docker/102/lib/python2.7/site-packages/compose/cli/command.py", line 84, in get_project
    config_details = config.find(project_dir, config_path, environment, override_dir)
  File "/snap/docker/102/lib/python2.7/site-packages/compose/config/config.py", line 240, in find
    os.path.abspath(override_dir),
  File "/snap/docker/102/usr/lib/python2.7/posixpath.py", line 360, in abspath
    if not isabs(path):
  File "/snap/docker/102/usr/lib/python2.7/posixpath.py", line 54, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

Piping a docker-compose.yaml from stdin to docker.compose doesn't work in 1.12.0 which is the one we're using for docker_17.03.1-ce-1 snapping. It's officially fixed in 1.13.0.
We need to use the latest docker compose to create the next docker snap once the upcoming quarterly release of docker(17.06-ce) is out.