Skip to content

Commit

Permalink
check to see if container is already running
Browse files Browse the repository at this point in the history
so we can crash out on errors correctly if the build fails
  • Loading branch information
mcnewton committed May 15, 2019
1 parent b2edeb3 commit bc007a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/docker/crossbuild/crossbuild.mk
Expand Up @@ -90,10 +90,11 @@ $(DD)/stamp-image.${1}:
.PHONY: $(DD)/docker.up.${1}
$(DD)/docker.up.${1}: $(DD)/stamp-image.${1}
@echo "START ${1} ($(CB_CPREFIX)${1})"
@docker run -d --rm \
@docker container inspect $(CB_CPREFIX)${1} >/dev/null 2>&1 || \
docker run -d --rm \
--mount=type=bind,source="$(GITDIR)",destination=/srv/src,ro \
--name $(CB_CPREFIX)${1} $(CB_IPREFIX)/${1} \
/bin/sh -c 'while true; do sleep 60; done' >/dev/null 2>&1 || true
/bin/sh -c 'while true; do sleep 60; done' >/dev/null

$(DD)/stamp-up.${1}: $(DD)/docker.up.${1}
@touch $(DD)/stamp-up.${1}
Expand Down

0 comments on commit bc007a2

Please sign in to comment.