anchor.diff:  start() {
       [ -x $docker ] || exit 5
   
  -    if [ -f $cidfile ]; then
  -        cid="$(cat $cidfile)"
  -        if [ -n "$cid" ]; then
  -            $docker ps --no-trunc=true|grep $cid
  -            retval=$?
  -            if [ $retval -eq 0 ]; then
  -                failure
  -                echo
  -                printf "Container $cid is still running.\n"
  -                exit 7
  -            else
  -                rm -f $lockfile
  -            fi
  -        fi
  +    if [ "true" = "$($docker inspect --format='{{.State.Running}}' <%= @sanitised_title %>)" ]; then
  +       failure
  +       printf "Container <%= @sanitised_title %> is still running.\n"
  +       exit 7
       fi
   
       printf "Starting $prog:\t"
  +    $docker rm <%= @sanitised_title %> >/dev/null 2>&1
       <% if @pull_on_start -%>
           $docker pull <%= @image %>
       <% end -%>
  -    if [ -f $cidfile ]; then
  -    <% if @use_name -%>
  -        $docker start <%= @name %>
  -    <% else -%>
  -        $docker start $(cat $cidfile)
  -    <% end -%>
  -    else
  -        $docker run --cidfile=$cidfile \
  -        <%= @docker_run_flags %> \
  -        <% if @use_name %>--name <%= @name %><% end %> \
  -        <% if @extra_parameters %><% @extra_parameters_array.each do |param| %>  \
  -            <%= param %> <% end %> \
  -        <% end -%> \
  -        <%= @image %> \
  -       <% if @command %> <%= @command %><% end %>
  +    $docker run \
  +    <%= @docker_run_flags %> \
  +    --name <%= @sanitised_title %> \
  +    <% if @extra_parameters %><% @extra_parameters_array.each do |param| %>  \
  +        <%= param %> <% end %> \
  +    <% end -%> \
  +    <%= @image %> \
  +    <% if @command %> <%= @command %><% end %>
   
  -    fi
       retval=$?
       echo
       if [ $retval -eq 0 ]; then
  -	[ -n "$lockfile" ] && touch $lockfile
           success
       else
           failure
  
positive.code: }
  
  stop() {
      if ! [ -f $cidfile ]; then
          failure
          echo
          printf "$cidfile does not exist.\n"
          exit 7
      else
          cid="$(cat $cidfile)"
          if [ -n $cid ]; then
              echo -n $"Stopping $prog: "
              $docker stop $(cat $cidfile)
              retval=$?
              [ $retval -eq 0 ] && rm -f $lockfile
              return $retval
          fi
      fi
  }
  
  case "$1" in
  
negative.code:     stop
      ;;
      status)
      if [ "false" = "$($docker inspect --format='{{.State.Running}}' <%= @sanitised_title %>)" ]; then
          echo $prog not running
          exit 1
      else
          echo $prog is running
          exit 0
      fi
      ;;
      restart|reload)
      stop
  