Skip to content

streaming from build() is broken in 0.3.0 #176

@rosenhouse

Description

@rosenhouse

Some client code that was working fine w/ docker-py 0.2.3 now breaks on 0.3.0

A minimal test case looks like:

ubuntu@ip-10-77-1-34:/tmp/foo$ cat Dockerfile
FROM stackbrew/ubuntu:13.04
RUN echo "hello"
CMD /bin/bash

ubuntu@ip-10-77-1-34:/tmp/foo$ cat test.py
import docker

doc = docker.Client()
gen = doc.build(path='.', stream=True)
for line in gen:
    print line

Executing test.py under 0.2.3 builds the image fine. Under 0.3.0, I get

ubuntu@ip-10-77-1-34:/tmp/foo$ python test.py
{"stream":" ---\u003e Using cache\n"}

Traceback (most recent call last):
  File "test.py", line 5, in <module>
    for line in gen:
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 239, in _stream_helper
    size = int(socket.readline(), 16)
ValueError: invalid literal for int() with base 16: ''

This is Ubuntu 12.04 w/ Docker 0.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions