Skip to content

Commit

Permalink
docker provider: Don't explode when removing an image if it is in use
Browse files Browse the repository at this point in the history
Handles the slightly different error text when podman backend is used:
`Stderr: Error response from daemon: image xxx is in use: image used by yyy: image is in use by a container: consider listing external containers and force-removing image
`
  • Loading branch information
eszense authored Jan 4, 2025
1 parent 216835c commit 81d56a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/providers/docker/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ def rmi(id)
execute('docker', 'rmi', id)
return true
rescue => e
return false if e.to_s.include?("is using it")
return false if e.to_s.include?("is being used")
return false if e.to_s.include?("is using it") or
e.to_s.include?("is being used") or
e.to_s.include?("is in use")
raise if !e.to_s.include?("No such image")
end

Expand Down

0 comments on commit 81d56a8

Please sign in to comment.