Skip to content

build image error:OSError: unexpected end of data #2241

Open
@YuMiaoPy

Description

My code is below, I can connect docker server successfuly,but trying to build image fails.

import docker

client = docker.DockerClient(base_url='tcp://47.92.241.134:2375'
,timeout=30,version='1.27',tls=False)
client.login(username='ssyptxz1',password='Siacloud'
,registry='https://registry.cn-zhangjiakou.aliyuncs.com')
f=open('E:\11\Dockerfile.tar', 'r',encoding='utf-8')
client.images.build(fileobj=f
,tag='registry.cn-zhangjiakou.aliyuncs.com/siacloud/sia-app-yumiao:1.2')

outputs:OSError: unexpected end of data
docker server info:
{'Version': '17.03.2-ce', 'ApiVersion': '1.27', 'MinAPIVersion': '1.12', 'GitCommit': 'f5ec1e2', 'GoVersion': 'go1.6.2', 'Os': 'linux', 'Arch': 'amd64', 'KernelVersion': '4.4.0-117-generic', 'BuildTime': '2018-07-05T23:07:48.822836586+00:00'}

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions