Docker(在boot2docker下)在构建时不寻找/查找本地映像 [英] Docker (under boot2docker) does not look for/find local images when building

查看:284
本文介绍了Docker(在boot2docker下)在构建时不寻找/查找本地映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在boot2docker 1.3.1下运行Docker on OS X 1.3.1



我自己构建了一个图像, oceania / python

  $ docker images 
REPOSITORY TAG IMAGE ID创建的虚拟大小
oceania / python 0.1 800229a896ff 16小时前510.4 MB

我现在有另一个Dockerfile,我想使用 FROM oceania / python



当我尝试构建此图像时,我得到:

 将构建上下文发送到Docker守护程序31.74 MB 
将构建上下文发送到Docker守护程序
步骤0:FROM oceania / python
提取存储区oceania / python
2014/11/20 17:23:51错误:image oceania / python not found

不要先看看我的本地图片,然后上网尝试拉扯?



我真的有义务将其上传到存储库吗?



@jpe tazzo在这里回答说,我在做什么应该工作:

https://stackoverflow.com/a/20501690/ 202168



我假设问题可能是boot2docker相关的

解决方案

呃,好的...



似乎我必须包含标签,即

  FROM oceania / python:0.1 

...然后它工作。



文档似乎允许没有标签的 FROM 指令,他们说:如果没有给出FROM指令的标签,则假定最新的。



我猜根本的问题是,如果您的图像没有上传到某个地方的索引,则无法将最新解析为标签。



另一件令人困惑的事情是,在其他人的答案和simil例如自动码头服务器构建运行错误:无法找到图像,他们得到一些如下所示的输出:

 无法在本地找到图片'foo / bar:baz'

但是在我的输出中,没有什么可说的docker甚至试图在本地看看


I'm running Docker on OS X under boot2docker 1.3.1

I built myself an image, oceania/python:

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
oceania/python      0.1                 800229a896ff        16 hours ago        510.4 MB

I have another Dockerfile now where I want to use FROM oceania/python

When I try to build this image I get:

Sending build context to Docker daemon 31.74 MB
Sending build context to Docker daemon
Step 0 : FROM oceania/python
Pulling repository oceania/python
2014/11/20 17:23:51 Error: image oceania/python not found

Shouldn't it look at my local images first before going online to try and pull it?

Am I really obliged to upload it to a repository?

@jpetazzo answers here that what I am doing should work:
https://stackoverflow.com/a/20501690/202168

I assume the problem may therefore be boot2docker related

解决方案

Uhhh, ok...

It seems I have to include the tag, i.e.

FROM oceania/python:0.1

...then it works.

The docs appear to allow a FROM directive without the tag, and they say: "If no tag is given to the FROM instruction, latest is assumed."

I guess the underlying problem is that if your image is not uploaded to an index somewhere then it can't resolve 'latest' to a tag.

Another thing that's confusing is it seems in other people's answers and comments on similar issue, eg automated docker build run error: Unable to find image they get some output that looks like:

Unable to find image 'foo/bar:baz' locally

but in my output there's nothing to say docker even tried to look locally

这篇关于Docker(在boot2docker下)在构建时不寻找/查找本地映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆