Skip to content

Print brief explanation if docker rm fails

What does this MR do?

This changes the Makefile to print a brief explanation instead of simply ignoring an error on docker rm.

Why was this MR needed?

Currently, first-time builders receive an error on every image that make build_current builds, as for example:

Error: No such container: gitlab-runner-prebuilt-arm64-b1ef628d
Makefile.runner_helper.mk:58: recipe for target 'out/helper-images/prebuilt-arm64.tar' failed
make: [out/helper-images/prebuilt-arm64.tar] Error 1 (ignored)

This is completely harmless, but it isn't immediately obvious that this doesn't indicate some problem with the configuration. (Sometimes there are problems building the images, such as the one recently fixed by !2165 (merged) . "Recipe failed" sounds like something that requires attention.)

Are there points in the code the reviewer needs to double check?

This uses a simple || rather than a proper conditional. Unfortunately it appears docker rm always spits out error code 1 regardless of the specific error, so while it would be better to have a more sophisticated conditional, it's not immediately obvious that any more sophistication is possible. Not sure of the best way to go there.

I used echo just because I saw echo used in ci/version. I don't know if you prefer to make any particular assumptions about the shell you're running on or whether you might want new code to use printf or whatever.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Edited by Steve Xuereb

Merge request reports