Skip to content
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

Use docker inspect to check image existence instead of docker images API #12

Closed
dkapanidis opened this issue Jun 27, 2015 · 1 comment
Closed

Comments

@dkapanidis
Copy link
Member

During captain build, in order to check if image already exists a call to 'docker image' is made. To improve response time the call should ask to filter by image name.

@dkapanidis dkapanidis changed the title Filter docker images by image name to improve response time Use docker inspect to check image existence instead of docker images API Jun 27, 2015
@dkapanidis
Copy link
Member Author

Improved captain build time considerably:

Version 0.1.1

➜  captain git:(master) time captain build
[CAPTAIN] Skipping build of harbur/captain:af6c60b - image is already built
[CAPTAIN] Tagging image harbur/captain:af6c60b as harbur/captain:latest
[CAPTAIN] Tagging image harbur/captain:af6c60b as harbur/captain:master
[CAPTAIN] Skipping build of harbur/captain-test:af6c60b - image is already built
[CAPTAIN] Tagging image harbur/captain-test:af6c60b as harbur/captain-test:latest
[CAPTAIN] Tagging image harbur/captain-test:af6c60b as harbur/captain-test:master
captain build  0,02s user 0,04s system 2% cpu 3,104 total

3 seconds to skip builds of two images.

With applied change:

➜  captain git:(master) time captain build                                                                                              
[CAPTAIN] Skipping build of harbur/captain:af6c60b - image is already built
[CAPTAIN] Tagging image harbur/captain:af6c60b as harbur/captain:latest
[CAPTAIN] Tagging image harbur/captain:af6c60b as harbur/captain:master
[CAPTAIN] Skipping build of harbur/captain-test:af6c60b - image is already built
[CAPTAIN] Tagging image harbur/captain-test:af6c60b as harbur/captain-test:latest
[CAPTAIN] Tagging image harbur/captain-test:af6c60b as harbur/captain-test:master
captain build  0,03s user 0,01s system 18% cpu 0,208 total

0.2 seconds to skip builds of two images.

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

1 participant