Created
April 8, 2016 00:48
-
-
Save jimjh/cd4ecbd47cd5f37ca15fe22861e70f58 to your computer and use it in GitHub Desktop.
Resize docker terminals to a sensible width/height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: ./resize.sh [container ID]+ | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
sudo apt-get -qqy install jq socat | |
while [[ -n ${1:-''} ]]; do | |
container_id=$(docker inspect ${1} | jq -r '.[0].Id') | |
socat unix-connect:/run/docker.sock stdio <<-HEREDOC | |
POST /v1.16/containers/${container_id}/resize?h=70&w=283 HTTP/1.1 | |
HEREDOC | |
shift | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment