module Docker
Public Instance Methods
container_id(container_name)
click to toggle source
# File lib/utils/docker.rb, line 15 def container_id(container_name) id = docker(%(container ps -q --filter "name=#{container_name}")).stdout id.empty? ? raise(Error, "container with name #{container_name} does not exist") : id end
docker(command)
click to toggle source
# File lib/utils/docker.rb, line 24 def docker(command) command = "docker #{command}" run(command).tap do |output| raise(Error, "Failed to run: #{command}\n#{output}") if output.error? end end
docker_exec(command)
click to toggle source
# File lib/utils/docker.rb, line 20 def docker_exec(command) system "docker exec #{command}" end