{"action":"created","issue":{"url":"https://api.github.com/repos/goldmann/docker-squash/issues/158","repository_url":"https://api.github.com/repos/goldmann/docker-squash","labels_url":"https://api.github.com/repos/goldmann/docker-squash/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/goldmann/docker-squash/issues/158/comments","events_url":"https://api.github.com/repos/goldmann/docker-squash/issues/158/events","html_url":"https://github.com/goldmann/docker-squash/issues/158","id":293418986,"node_id":"MDU6SXNzdWUyOTM0MTg5ODY=","number":158,"title":"AttributeError: 'generator' object has no attribute 'read' with new python docker client version 3.0","user":{"login":"eyenx","id":1947882,"node_id":"MDQ6VXNlcjE5NDc4ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/1947882?v=4","gravatar_id":"","url":"https://api.github.com/users/eyenx","html_url":"https://github.com/eyenx","followers_url":"https://api.github.com/users/eyenx/followers","following_url":"https://api.github.com/users/eyenx/following{/other_user}","gists_url":"https://api.github.com/users/eyenx/gists{/gist_id}","starred_url":"https://api.github.com/users/eyenx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyenx/subscriptions","organizations_url":"https://api.github.com/users/eyenx/orgs","repos_url":"https://api.github.com/users/eyenx/repos","events_url":"https://api.github.com/users/eyenx/events{/privacy}","received_events_url":"https://api.github.com/users/eyenx/received_events","type":"User","site_admin":false},"labels":[{"id":132964584,"node_id":"MDU6TGFiZWwxMzI5NjQ1ODQ=","url":"https://api.github.com/repos/goldmann/docker-squash/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"goldmann","id":43489,"node_id":"MDQ6VXNlcjQzNDg5","avatar_url":"https://avatars2.githubusercontent.com/u/43489?v=4","gravatar_id":"","url":"https://api.github.com/users/goldmann","html_url":"https://github.com/goldmann","followers_url":"https://api.github.com/users/goldmann/followers","following_url":"https://api.github.com/users/goldmann/following{/other_user}","gists_url":"https://api.github.com/users/goldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/goldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldmann/subscriptions","organizations_url":"https://api.github.com/users/goldmann/orgs","repos_url":"https://api.github.com/users/goldmann/repos","events_url":"https://api.github.com/users/goldmann/events{/privacy}","received_events_url":"https://api.github.com/users/goldmann/received_events","type":"User","site_admin":false},"assignees":[{"login":"goldmann","id":43489,"node_id":"MDQ6VXNlcjQzNDg5","avatar_url":"https://avatars2.githubusercontent.com/u/43489?v=4","gravatar_id":"","url":"https://api.github.com/users/goldmann","html_url":"https://github.com/goldmann","followers_url":"https://api.github.com/users/goldmann/followers","following_url":"https://api.github.com/users/goldmann/following{/other_user}","gists_url":"https://api.github.com/users/goldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/goldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldmann/subscriptions","organizations_url":"https://api.github.com/users/goldmann/orgs","repos_url":"https://api.github.com/users/goldmann/repos","events_url":"https://api.github.com/users/goldmann/events{/privacy}","received_events_url":"https://api.github.com/users/goldmann/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/goldmann/docker-squash/milestones/12","html_url":"https://github.com/goldmann/docker-squash/milestone/12","labels_url":"https://api.github.com/repos/goldmann/docker-squash/milestones/12/labels","id":2747565,"node_id":"MDk6TWlsZXN0b25lMjc0NzU2NQ==","number":12,"title":"1.0.7","description":null,"creator":{"login":"goldmann","id":43489,"node_id":"MDQ6VXNlcjQzNDg5","avatar_url":"https://avatars2.githubusercontent.com/u/43489?v=4","gravatar_id":"","url":"https://api.github.com/users/goldmann","html_url":"https://github.com/goldmann","followers_url":"https://api.github.com/users/goldmann/followers","following_url":"https://api.github.com/users/goldmann/following{/other_user}","gists_url":"https://api.github.com/users/goldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/goldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldmann/subscriptions","organizations_url":"https://api.github.com/users/goldmann/orgs","repos_url":"https://api.github.com/users/goldmann/repos","events_url":"https://api.github.com/users/goldmann/events{/privacy}","received_events_url":"https://api.github.com/users/goldmann/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":4,"state":"open","created_at":"2017-09-06T09:28:22Z","updated_at":"2018-06-11T13:50:03Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2018-02-01T06:34:59Z","updated_at":"2018-06-11T13:54:32Z","closed_at":"2018-06-11T13:50:03Z","author_association":"NONE","body":"Hello \r\n\r\nWe use docker-squash on a daily basis to squash our base-images. Today we can't squash the images anymore. We get: \r\n\r\n```\r\n$ docker-squash -t registry.example.com/alpine  registry.exmaple.com/alpine\r\n2018-02-01 06:24:59,601 root         INFO     docker-squash version 1.0.6, Docker c97c6d6, API 1.35...\r\n2018-02-01 06:24:59,602 root         INFO     Using v2 image format\r\n2018-02-01 06:24:59,614 root         INFO     Old image has 4 layers\r\n2018-02-01 06:24:59,615 root         INFO     Checking if squashing is necessary...\r\n2018-02-01 06:24:59,615 root         INFO     Attempting to squash last 4 layers...\r\n2018-02-01 06:24:59,615 root         INFO     Saving image sha256:370c6891b7c58c64a715aaf93f17e1e10c8a4e4e3533e04a0959f1f205756cbe to /tmp/docker-squash-ujuyJb/old directory...\r\n2018-02-01 06:25:00,849 root         ERROR    'generator' object has no attribute 'read'\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/site-packages/docker_squash/image.py\", line 321, in _save_image\r\n    with tarfile.open(fileobj=image, mode='r|') as tar:\r\n  File \"/usr/lib/python2.7/tarfile.py\", line 1705, in open\r\n    t = cls(name, filemode, stream, **kwargs)\r\n  File \"/usr/lib/python2.7/tarfile.py\", line 1587, in __init__\r\n    self.firstmember = self.next()\r\n  File \"/usr/lib/python2.7/tarfile.py\", line 2358, in next\r\n    tarinfo = self.tarinfo.fromtarfile(self)\r\n  File \"/usr/lib/python2.7/tarfile.py\", line 1251, in fromtarfile\r\n    buf = tarfile.fileobj.read(BLOCKSIZE)\r\n  File \"/usr/lib/python2.7/tarfile.py\", line 579, in read\r\n    buf = self._read(size)\r\n  File \"/usr/lib/python2.7/tarfile.py\", line 587, in _read\r\n    return self.__read(size)\r\n  File \"/usr/lib/python2.7/tarfile.py\", line 612, in __read\r\n    buf = self.fileobj.read(self.bufsize)\r\nAttributeError: 'generator' object has no attribute 'read'\r\n```\r\n\r\nDocker-squash was installed on our builder Image (docker:latest) by pip:\r\n\r\n```\r\n$ pip install docker-squash\r\nCollecting docker-squash\r\n  Downloading docker-squash-1.0.6.tar.gz\r\nCollecting docker (from docker-squash)\r\n  Downloading docker-3.0.0-py2.py3-none-any.whl (120kB)\r\nCollecting six (from docker-squash)\r\n  Downloading six-1.11.0-py2.py3-none-any.whl\r\nCollecting backports.ssl-match-hostname>=3.5; python_version < \"3.5\" (from docker->docker-squash)\r\n  Downloading backports.ssl_match_hostname-3.5.0.1.tar.gz\r\nCollecting ipaddress>=1.0.16; python_version < \"3.3\" (from docker->docker-squash)\r\n  Downloading ipaddress-1.0.19.tar.gz\r\nCollecting docker-pycreds>=0.2.1 (from docker->docker-squash)\r\n  Downloading docker_pycreds-0.2.1-py2.py3-none-any.whl\r\nCollecting requests!=2.18.0,>=2.14.2 (from docker->docker-squash)\r\n  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)\r\nCollecting websocket-client>=0.32.0 (from docker->docker-squash)\r\n  Downloading websocket_client-0.46.0-py2.py3-none-any.whl (200kB)\r\nCollecting chardet<3.1.0,>=3.0.2 (from requests!=2.18.0,>=2.14.2->docker->docker-squash)\r\n  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)\r\nCollecting certifi>=2017.4.17 (from requests!=2.18.0,>=2.14.2->docker->docker-squash)\r\n  Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB)\r\nCollecting urllib3<1.23,>=1.21.1 (from requests!=2.18.0,>=2.14.2->docker->docker-squash)\r\n  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)\r\nCollecting idna<2.7,>=2.5 (from requests!=2.18.0,>=2.14.2->docker->docker-squash)\r\n  Downloading idna-2.6-py2.py3-none-any.whl (56kB)\r\nInstalling collected packages: backports.ssl-match-hostname, ipaddress, six, docker-pycreds, chardet, certifi, urllib3, idna, requests, websocket-client, docker, docker-squash\r\n  Running setup.py install for backports.ssl-match-hostname: started\r\n    Running setup.py install for backports.ssl-match-hostname: finished with status 'done'\r\n  Running setup.py install for ipaddress: started\r\n    Running setup.py install for ipaddress: finished with status 'done'\r\n  Running setup.py install for docker-squash: started\r\n    Running setup.py install for docker-squash: finished with status 'done'\r\nSuccessfully installed backports.ssl-match-hostname-3.5.0.1 certifi-2018.1.18 chardet-3.0.4 docker-3.0.0 docker-pycreds-0.2.1 docker-squash-1.0.6 idna-2.6 ipaddress-1.0.19 requests-2.18.4 six-1.11.0 urllib3-1.22 websocket-client-0.46.0\r\n```\r\n\r\nThe only thing that changed from yesterday is the docker python client we are using:\r\n\r\n```\r\nCollecting docker (from docker-squash)\r\n  Downloading docker-3.0.0-py2.py3-none-any.whl (120kB)\r\n```\r\n\r\nYesterday it worked, but we were using docker-2.7.0.\r\n\r\nCan you look into this?\r\n\r\nThanks\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/goldmann/docker-squash/issues/comments/396251382","html_url":"https://github.com/goldmann/docker-squash/issues/158#issuecomment-396251382","issue_url":"https://api.github.com/repos/goldmann/docker-squash/issues/158","id":396251382,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjI1MTM4Mg==","user":{"login":"Cryptophobia","id":15237494,"node_id":"MDQ6VXNlcjE1MjM3NDk0","avatar_url":"https://avatars3.githubusercontent.com/u/15237494?v=4","gravatar_id":"","url":"https://api.github.com/users/Cryptophobia","html_url":"https://github.com/Cryptophobia","followers_url":"https://api.github.com/users/Cryptophobia/followers","following_url":"https://api.github.com/users/Cryptophobia/following{/other_user}","gists_url":"https://api.github.com/users/Cryptophobia/gists{/gist_id}","starred_url":"https://api.github.com/users/Cryptophobia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cryptophobia/subscriptions","organizations_url":"https://api.github.com/users/Cryptophobia/orgs","repos_url":"https://api.github.com/users/Cryptophobia/repos","events_url":"https://api.github.com/users/Cryptophobia/events{/privacy}","received_events_url":"https://api.github.com/users/Cryptophobia/received_events","type":"User","site_admin":false},"created_at":"2018-06-11T13:54:32Z","updated_at":"2018-06-11T13:54:32Z","author_association":"NONE","body":"@goldmann : Awesome!"}}
{"actor":{"display_login":"Cryptophobia"}}