From 8a0c7997b8324e899ac35a644fbc825849e07de4 Mon Sep 17 00:00:00 2001 From: Leonardo G Date: Mon, 15 Mar 2021 14:24:33 -0300 Subject: [PATCH] add container resize support --- lib/docker/container.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/docker/container.rb b/lib/docker/container.rb index a203b3fdc..366722e03 100644 --- a/lib/docker/container.rb +++ b/lib/docker/container.rb @@ -322,6 +322,18 @@ def store_file(path, file_content) archive_in_stream("/", overwrite: true) { output_io.read } end + # Resize the TTY associated with the Container instance + # + # @param query [Hash] API query parameters + # @option query [Fixnum] h Height of the TTY + # @option query [Fixnum] w Width of the TTY + # + # @return [Docker::Container] self + def resize(query = {}) + connection.post(path_for(:resize), query) + self + end + # Create a new Container. def self.create(opts = {}, conn = Docker.connection) query = opts.select {|key| ['name', :name].include?(key) }