Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/fantasmo/public_html/ash.wine/wp-content/plugins/jetpack/jetpack.php:1) in /home/fantasmo/public_html/ash.wine/wp-includes/rest-api/class-wp-rest-server.php on line 1775
{"id":278,"date":"2016-08-30T16:34:00","date_gmt":"2016-08-30T11:04:00","guid":{"rendered":"http:\/\/ash.wine\/?p=278"},"modified":"2016-11-18T15:27:29","modified_gmt":"2016-11-18T09:57:29","slug":"how-to-open-another-terminalbash-instance-in-a-running-docker-container","status":"publish","type":"post","link":"http:\/\/hacks.ash.wine\/how-to-open-another-terminalbash-instance-in-a-running-docker-container\/","title":{"rendered":"How To Open Another Terminal\/Bash Instance In A Running Docker Container"},"content":{"rendered":"
\n

\n<\/span><\/a>How To Open Another Terminal\/Bash Instance In A Running Docker Container<\/h1>\n

Add the following to your bashrc.<\/p>\n

\n
#Add another docker window<\/span>\nfunction<\/span> dock()<\/span>\n{\n  if<\/span> [ \"<\/span>$1<\/span>\"<\/span><\/span> ==<\/span> \"<\/span>-h\"<\/span><\/span> ]\n  then<\/span>\n    #display help<\/span>\n    printf<\/span>  \"<\/span>Attaches this window as a new terminal (bash) instance to a running docker container\\n\"<\/span><\/span>\n    printf<\/span>  \"<\/span>Usage: 'dock' or 'dock 6548as846'\\n\"<\/span><\/span>\n    printf<\/span>  \"<\/span>Accepts container name or id\\n\"<\/span><\/span>\n    printf<\/span>  \"<\/span>If no ID is given, then attaches to first found process.\\n\"<\/span><\/span>\n  elif<\/span> [ $#<\/span> -eq<\/span> 0 ]\n  then<\/span>\n    #Get the first process<\/span>\n    dockerpid=\"<\/span>$(<\/span>docker ps -q |<\/span> head -1)<\/span><\/span>\"<\/span><\/span>\n    echo<\/span> $dockerpid<\/span>\n    sudo docker exec<\/span> -i -t $dockerpid<\/span> \/bin\/bash\n  elif<\/span> [ \"<\/span>$1<\/span>\"<\/span><\/span> !=<\/span> \"<\/span>-h\"<\/span><\/span> ]\n  then<\/span>\n    #Open terminal in that process<\/span>\n    sudo docker exec<\/span> -i -t $1<\/span> \/bin\/bash\n  fi<\/span>\n}<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

How To Open Another Terminal\/Bash Instance In A Running Docker Container Add the following to your bashrc. #Add another docker window function dock() { if [ “$1” == “-h” ] then #display help printf “Attaches this window as a new terminal (bash) instance to a running docker container\\n” printf “Usage: ‘dock’ or ‘dock 6548as846’\\n” printf […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[16,17],"_links":{"self":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts\/278"}],"collection":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":1,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"predecessor-version":[{"id":279,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/posts\/278\/revisions\/279"}],"wp:attachment":[{"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ash.wine\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}