Skip to content

client.build unable to fetch local images with docker 1.7.0 #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
garyservin opened this issue Jun 28, 2015 · 2 comments
Closed

client.build unable to fetch local images with docker 1.7.0 #657

garyservin opened this issue Jun 28, 2015 · 2 comments

Comments

@garyservin
Copy link

When using docker 1.7.0 client.build is unable to fetch local images and tries to download it from the internet. Tested also version 1.2.2 of docker-py and the same issue persists.

Here you can see the output of the test.

➜  devel  docker -v
Docker version 1.7.0, build 0baf609
➜  devel  pip show docker-py

---
Name: docker-py
Version: 1.2.3
Location: /usr/local/lib/python2.7/dist-packages
Requires: requests, six, websocket-client
➜  devel  docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
testing             latest              7425392ede6b        27 minutes ago      188.3 MB
ubuntu              14.04               6d4946999d4f        2 weeks ago         188.3 MB
➜  devel  python test.py 

Output of Client.images():
testing:latest
ubuntu:14.04

Output of Client.build():
Step 0 : FROM testing
Pulling repository testing
Error: image library/testing:latest not found
➜  devel  

and here is the simplified version of the test.py

from io import BytesIO
from docker import Client

dockerfile = '''
    # Shared Volume
    FROM testing
    MAINTAINER Gary Servin, garyservin@gmail.com
    RUN echo "Hello World!"
    '''
f = BytesIO(dockerfile.encode('utf-8'))

cli = Client(base_url='unix://var/run/docker.sock')

print
print "Output of Client.images():"
for line in cli.images():
        print line # pretty printed in the shell output


print
print "Output of Client.build():"
for line in cli.build(fileobj=f, rm=True, tag='testing'):
        print line  # pretty printed in the shell output
@TomasTomecek
Copy link
Contributor

Maybe this?

moby/moby#11480
moby/moby#11955

@shin-
Copy link
Contributor

shin- commented Jun 29, 2015

Client.build(..., pull=False)

See also #622 #624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants