docker --detatch

Makefile
--------
   * Move -d/--detach argument back into cmd[1].
   * Trailing arguments seem to be passed to bbsim -vs- docker run.

Change-Id: Icd2a18438685e52595a058622ce1f0059b7f05a1
diff --git a/Makefile b/Makefile
index 25eb3fc..fd8abd7 100644
--- a/Makefile
+++ b/Makefile
@@ -132,7 +132,13 @@
 ## -----------------------------------------------------------------------
 ## docker-run
 ## -----------------------------------------------------------------------
+
+# % docker run --detach unless dev-mode
+is-docker-run := $(filter-out %-dev,$(MAKECMDGOALS))
+is-docker-run := $(findstring docker-run,$(is-docker-run))
+
 docker-run-cmd  = docker run
+$(if $(is-docker-run),$(eval docker-run-cmd += --detach))
 docker-run-cmd += ${DOCKER_PORTS}
 docker-run-cmd += --privileged
 docker-run-cmd += --rm
@@ -142,7 +148,7 @@
 
 docker-run: # @HELP Runs the container locally (available options: DOCKER_RUN_ARGS="-pon 2 -onu 2" make docker-run)
 	docker ps
-	$(docker-run-cmd) --detach
+	$(docker-run-cmd)
 
 docker-run-dev: # @HELP Runs the container locally (intended for development purposes, not in detached mode)
 	$(docker-run-cmd)