attach_container.sh 509 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

name="$USER"_work

usage()
{
    echo "Help:"
    echo "-n, --name - name of a container. Default is" $USER"_work."
}

while [ "$1" != "" ]; do
    case $1 in
        -n | --name )               shift
                                    name="$1"
                                    ;;
        -h | --help )               usage
                                    exit
                                    ;;
        * )                         break
    esac
    shift
done

docker attach $name