devops: gracefully handle stopping already-stopped container (#16528)

This commit is contained in:
Andrey Lushnikov 2022-08-14 14:17:28 -07:00 committed by GitHub
parent 7942d296f1
commit 81ed8fc523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,7 @@ elif [[ "$2" == "compile" ]]; then
elif [[ "$2" == "enter" ]]; then elif [[ "$2" == "enter" ]]; then
docker run --rm ${DOCKER_ARGS} --init --name "${DOCKER_CONTAINER_NAME}" --platform "${DOCKER_PLATFORM}" -it "${DOCKER_IMAGE_NAME}" /bin/bash docker run --rm ${DOCKER_ARGS} --init --name "${DOCKER_CONTAINER_NAME}" --platform "${DOCKER_PLATFORM}" -it "${DOCKER_IMAGE_NAME}" /bin/bash
elif [[ "$2" == "kill" || "$2" == "stop" ]]; then elif [[ "$2" == "kill" || "$2" == "stop" ]]; then
docker kill "${DOCKER_CONTAINER_NAME}" docker kill "${DOCKER_CONTAINER_NAME}" || true
# Wait for container to stop # Wait for container to stop
docker wait "${DOCKER_CONTAINER_NAME}" || true docker wait "${DOCKER_CONTAINER_NAME}" || true
else else