runcmd 513 Bytes
Newer Older
GONZALES ZUNIGA Juan Diego's avatar
GONZALES ZUNIGA Juan Diego committed
1
2
#!/bin/bash
myimage=local/dockervino:phase1_R3
3
myname=dockervinoph1
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

set -x
docker run \
  -d \
  -ti \
  --env="PS1=$myname> "\
  --publish-all=true \
  --hostname=$myname \
  --name $myname \
  --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