runcmd 539 Bytes
Newer Older
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
1

2
3
myimage=local/dockervino:phase1
myname=dockervino
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

set -x
docker run \
  -d \
  -ti \
  --env="PS1=$myname> "\
  --publish-all=true \
  --hostname=$myname \
  --name $myname \
  -v /tmp/.X11-unix/:/tmp/.X11-unix/:ro  \
  --cidfile=/tmp/monitcont.id \
        $myimage /bin/bash 
        contid=$(cat /tmp/monitcont.id; rm -f /tmp/monitcont.id)
set +x
        $debug docker logs $contid
        $debug docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $1 $contid
set +x