-
Notifications
You must be signed in to change notification settings - Fork 31
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
build_images returns docker.errors.BuildError #4
Comments
The interface for docker-py has changed. If you want the build output looks like you need to get the APIClient from docker-py and call the low level build there. The low level build returns a stream of output but no Image object. The image object isn't used anyways.. |
here's some updated snippets to help you. Good luck! I'm just trying this repo out right now but it looks promising in terms of what I want to do.
|
I've replaced
image, build_logs =
self.cli.images.build(path=f'./docker/{directory_name}',
tag=directory_name, rm=True)
with
self.cli.images.build(path=f'./docker/{directory_name}',
tag=directory_name, rm=True)
but it did not work
Em seg, 13 de mai de 2019 às 13:49, Anthony Chen <notifications@github.com>
escreveu:
… The interface for docker-py has changed.
self.cli.images.build only returns an Image now
Update build_task to ignore the output of self.cli.images.build and this
will let you build using this script
This means you won't get the build output anymore
If you want the build output looks like you need to get the APIClient from
docker-py and call the low level build there. The low level build returns a
stream of output but no Image object. The image object isn't used anyways..
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARZZLA5FI76CUQDWF65MUDPVGL2NANCNFSM4HLTYCAQ>
.
|
You can be done using the low-level APIs given in docker-py as follows:
` |
Is this still an issue? Could any of you make a tiny pull request fixing this? :) |
I am on master, running in RHEL 7, with docker-py 3.7.2, Docker version 18.03.1-ce, build 9ee9f40.
When I run python build_images.py, I get:
2019-05-08 13:50:27,272 - build_images - INFO - No particular task name specified. Will build every image in /docker/.
2019-05-08 13:50:27,272 - build_images - INFO - Browsing ['task3', 'task1', 'task2']
2019-05-08 13:50:27,272 - build_images - INFO - Handling task3
2019-05-08 13:50:27,272 - build_images - INFO - Copying ./python/libraries/papermill_runner to ./docker/task3/papermill_runner
2019-05-08 13:50:27,272 - build_images - INFO - Copying ./python/libraries/result_saver to ./docker/task3/result_saver
2019-05-08 13:50:27,273 - build_images - INFO - Building image. (run script with -l to see docker logs)
2019-05-08 13:56:56,834 - build_images - INFO - Cleaning up.
2019-05-08 13:56:56,834 - build_images - INFO - Removing ./docker/task3/papermill_runner
2019-05-08 13:56:56,834 - build_images - INFO - Removing ./docker/task3/result_saver
Traceback (most recent call last):
File "build_images.py", line 105, in
ImagesBuilder(parser).build_images()
File "build_images.py", line 33, in build_images
self.build_task(directory)
File "build_images.py", line 40, in build_task
image, build_logs = self.cli.images.build(path=f'./docker/{directory_name}', tag=directory_name, rm=True)
File "/opt/anaconda3/lib/python3.6/site-packages/docker/models/images.py", line 287, in build
raise BuildError(chunk['error'], result_stream)
docker.errors.BuildError: The command '/bin/sh -c pip install virtualenv' returned a non-zero code: 1
The text was updated successfully, but these errors were encountered: