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

images.build failing on container build output #1625

Closed
datwiz opened this issue May 26, 2017 · 0 comments
Closed

images.build failing on container build output #1625

datwiz opened this issue May 26, 2017 · 0 comments

Comments

@datwiz
Copy link

datwiz commented May 26, 2017

The ImageCollection.build() method parses the docker build output to extract the name of the image being built by looking for the string "Successfully built {sha256}". Some commands in a Dockerfile can also produce this string causing the build() method to return early with an incorrect image name.

Example output from a RUN pip install cffi command:

 ...
Building wheels for collected packages: cffi, pycparser
  Running setup.py bdist_wheel for cffi
  Stored in directory: /root/.cache/pip/wheels/ea/df/5c/7d11cd4eec7b94be3b0ec4ed0076e0f38846a22c7200576149
  Running setup.py bdist_wheel for pycparser
  Stored in directory: /root/.cache/pip/wheels/bc/07/7e/cd81c0b23417ebaed9eb2584c00bd539871d5309a7a2324953
Successfully built cffi pycparser
...

A partial fix is to make the regex used to search for the string more restrictive by adding start and end anchors. This can still result in some false positives.
A more complete fix only checks the last line of output for the "Success..." string.
PR in progress.

docker==2.3.0
docker-pycreds==0.2.1
Python 2.7.5
Client:
 Version:         1.12.6
 API version:     1.24
 Package version: docker-common-1.12.6-16.el7.x86_64
 Go version:      go1.7.4
 Git commit:      3a094bd/1.12.6
 Built:           Tue Mar 21 13:30:59 2017
 OS/Arch:         linux/amd64

Server:
 Version:         17.03.1-ce
 API version:     1.27
 Package version: 
 Go version:      go1.7.5
 Git commit:      c6d412e
 Built:           Fri Mar 24 00:00:50 2017
 OS/Arch:         linux/amd64
datwiz pushed a commit to datwiz/docker-py that referenced this issue May 26, 2017
… incorrect image_id depending on docer build output
datwiz pushed a commit to datwiz/docker-py that referenced this issue May 26, 2017
… incorrect image_id depending on docer build output

Signed-off-by: Chris Ottinger <chris.ottinger@team.telstra.com>
datwiz pushed a commit to datwiz/docker-py that referenced this issue May 27, 2017
…at verfies that the build method uses the last success message for extracting the image id

Signed-off-by: Chris Ottinger <chris.ottinger@team.telstra.com>
datwiz pushed a commit to datwiz/docker-py that referenced this issue May 27, 2017
Signed-off-by: Chris Ottinger <chris.ottinger@team.telstra.com>
@shin- shin- closed this as completed in 45aec93 Jun 19, 2017
shin- added a commit that referenced this issue Jun 19, 2017
fix #1625 where ImageCollection.build() could return with incorrect image id
@shin- shin- added this to the 2.4.0 milestone Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants