Skip to content
Snippets Groups Projects
Commit 7ec80da1 authored by John McDonnell's avatar John McDonnell Committed by Andrejs Cunskis
Browse files

Replace docker inspect with list filter

parent 443f733a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -119,19 +119,11 @@ module Gitlab
end
 
def container_exists?(name)
Docker::Command.execute("container inspect #{name}")
rescue Docker::Shellout::StatusError
false
else
true
!Docker::Command.execute("container list --all --format '{{.Names}}' --filter name=^#{name}$").empty?
end
 
def network_exists?(name)
Docker::Command.execute("network inspect #{name}")
rescue Docker::Shellout::StatusError
false
else
true
!Docker::Command.execute("network list --format '{{.Name}}' --filter name=^#{name}$").empty?
end
 
def network_create(name)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment