我正在开发dockerhub python客户端,我已经成功地完成了构建映像,但是现在我需要将这个docker映像推送到dockerhub存储库。
以下是我尝试过的:
来自 views.py
client = docker.from_env()
client.images.build(path=docker_folder, gzip=False, tag=deployment.name)
image = client.images.get(deployment.name)
print(image.short_id)
print("start pushing your docker image to docker hub")
auth_config = {
'username': '***dockerhub-email ***',
'password': '***Password***',
}
client.images.push('arycloud/istiogui', tag=deployment.name,
auth_config=auth_config)它不返回任何错误,但图像没有被推到码头枢纽报告。下面是我使用的存储库:
@Tarun评论后的更新代码
client = docker.from_env()
print("Start Building your docker image...")
client.images.build(path=docker_folder, gzip=False, tag=deployment.name)
image = client.images.get(deployment.name)
print(image.short_id)
print("start pushing your docker image to docker hub")
client.login(username='***', password='***')
client.images.push('arycloud/istiogui', tag=deployment.name)在那之后,我的形象还没有推到码头!
发布于 2019-12-10 05:46:29
你可以试试这个
client.login(username='***', password='***')
for line in client.images.push('arycloud/istiogui', stream=True, decode=True):
print(line)它将打印输出,这基本上是错误或成功的信息。
https://stackoverflow.com/questions/45452191
复制相似问题