docker py和build and push AttributeError:';图像';对象没有属性';推动';
如何使用docker py构建并推送到服务器docker py和build and push AttributeError:';图像';对象没有属性';推动';,docker,Docker,如何使用docker py构建并推送到服务器 docker_path = "/path/to/dockerfile/puredocker" build_image = docker_client.images.build(path=docker_path,tag=tag) image = build_image[0] print ('build_image:',build_image) for line in image.push(registry_na
docker_path = "/path/to/dockerfile/puredocker"
build_image = docker_client.images.build(path=docker_path,tag=tag)
image = build_image[0]
print ('build_image:',build_image)
for line in image.push(registry_name, stream=True):
print (line)
我的形象不是这样吗
build_image: (<Image: 'testme:latest'>, <itertools._tee object at 0x10d9d0ec8>)
我认为你应该使用
get
方法
docker_path = "/path/to/dockerfile/puredocker"
client.images.build(path=docker_path, tag=tagged)
image = client.images.get(<the name of the image>)
print(image.short_id)
client.images.push('registry/registry', tag=tagged)
docker_path=“/path/to/dockerfile/puredocker”
client.images.build(path=docker\u path,tag=taged)
image=client.images.get()
打印(图像。短\u id)
client.images.push('registry/registry',tag=taged)
docker_path = "/path/to/dockerfile/puredocker"
client.images.build(path=docker_path, tag=tagged)
image = client.images.get(<the name of the image>)
print(image.short_id)
client.images.push('registry/registry', tag=tagged)