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

Dockerfile with warnings breaks verbose boatswain #12

Open
sverhoeven opened this issue Jul 30, 2019 · 0 comments
Open

Dockerfile with warnings breaks verbose boatswain #12

sverhoeven opened this issue Jul 30, 2019 · 0 comments

Comments

@sverhoeven
Copy link
Member

A verbose boatswain build dies when a Dockerfile generates warnings during build.

Example files:

Dockerfile file:

FROM alpine

RUN hostname && \

# make room
date

The empty line after RUN will generate warnings.

boatswain.yml file:

version: 1.0
organisation: nlesc
images:
  sometest:
    context: .

Tested with Docker v19.03.1 and boatswain 1.0.3

Use docker build works:

docker build -t nlesc/sometest .
Sending build context to Docker daemon  10.24kB
[WARNING]: Empty continuation line found in:
    RUN hostname && date
[WARNING]: Empty continuation lines will become errors in a future release.
Step 1/2 : FROM alpine
 ---> cdf98d1859c1
Step 2/2 : RUN hostname && date
 ---> Using cache
 ---> 9045f64ed928
Successfully built 9045f64ed928
Successfully tagged nlesc/sometest:latest

Use boatswain build also works:

docker rmi nlesc/sometest
boatswain build 
Welcome to Boatswain
sometest             100% (2 of 2) │██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████│ Elapsed Time: 0:00:01

Build summary
built:
    sometest
Final result was deemed a: success

But using -v or -v -v fails with:

docker rmi nlesc/sometest
boatswain build -v
Welcome to Boatswain
Now building sometest in directory . and tagging as nlesc/sometest
----------           100% (1 of 1) │██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████│ Elapsed Time: 0:00:01
Traceback (most recent call last):
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/bin/boatswain", line 10, in <module>
    sys.exit(main())
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/cli.py", line 181, in main
    result = bosun.build(dryrun=arguments.dryrun, force=arguments.force)
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/boatswain.py", line 99, in build
    return self._do_action('build', dryrun=dryrun, force=force)
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/boatswain.py", line 118, in _do_action
    return self._do_action_dict(action, self.images, **kwargs)
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/boatswain.py", line 148, in _do_action_dict
    return self.build_list(names, images, **kwargs)
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/boatswain.py", line 252, in build_list
    if self.build_one(name, definition, dryrun=dryrun, force=force):
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/boatswain.py", line 405, in build_one
    ident = self._docker_progress(name, generator)
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/boatswain.py", line 563, in _docker_progress
    self.progress_bar.update()
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/boatswain/timed_progress_bar.py", line 35, in update
    self.progress_bar.update(self.step, imagename=self.imagename)
  File "/home/verhoes/.local/share/virtualenvs/q-VtrXc7DU/lib/python3.6/site-packages/progressbar/bar.py", line 568, in update
    % (value, self.min_value, self.max_value))
ValueError: Value 2 is out of range, should be between 0 and 1

The image is build, but boatswain dies.

Also the warnings from Docker are not shown.

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