empty:
  image: hyperledger/fabric-src
  # TCP Listen on a port to satisfy the container 'ready' condition
  command: nc -k -l 50000

empty:
  image: hyperledger/fabric-src
  # TCP Listen on a port to satisfy the container 'ready' condition
  # If we don't fork, trap and wait, nc (and by extension, the container)
  # won't respond to the SIGTERM that docker sends when it wants to stop.
  command: |
    sh -c '
      nc -k -l 50000 &
      pid=$$!
      trap "kill $$pid; exit 0" TERM
      wait $$pid
    '

Handle SIGTERM in empty docker-compose container
Handle SIGTERM in empty docker-compose container

In docker-compose-1-empty.yml nc was being invoked directly which led
to SIGTERM being ignored by the container. This added an unneccessary
10 second wait after tests that used it while docker timed out and
sends a SIGKILL. This fixes that by forking nc and trapping SIGTERM
and directly killing nc.

Change-Id: Ifc5072b33c45f9fa90868a87ca69982c051e10e1
Signed-off-by: Julian Carrivick <689bb502006712bd9777fa7f2dbac6f1e92d8c51@au1.ibm.com>
