Fix handling of missing image message with newer versions of Docker #3171
Conversation
At some unknown version, `docker inspect` stopped outputting "Error: No such image" and started outputting "Error: No such object:" when the image is question was missing. That change broke detecting that situation. This commit checks for either version of the message.
Great that you caught this though! So, this original string check is quite fragile then! The difference between the |
Looking at it again, I think we can handle non-zero exit codes from I can make that change. |
|
Thank you, this PR as-is improves the situation. If you'd like to make the update for non-zero exit codes, that would be great! But I'd like to get this fix in immediately. |
At some unknown version,
docker inspect
stopped outputting "Error: No suchimage" and started outputting "Error: No such object:" when the image is
question was missing. That change broke detecting that situation.
This commit checks for either version of the message.
Please include the following checklist in your PR:
Tested by running
stack build
in a project that needed a docker image that wasn't on this machine. Output before commit:And after: