From 4841b45a57a2fdaa098d195a3be259339c20690e Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 17 Jun 2019 22:20:47 +0900 Subject: [PATCH] Run dockerd manually if ischroot is detected --- btcpay-setup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/btcpay-setup.sh b/btcpay-setup.sh index b5cef2c..177125b 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -311,6 +311,14 @@ if ! [ -x "$(command -v docker-compose)" ]; then return fi +if $START && [ -x "$(command -v ischroot)" ] && ischroot; then + echo "chroot detected, running dockerd in background..." + dockerd & + echo "Waiting /var/run/docker.sock to be created..." + while [ ! -f "/var/run/docker.sock" ]; do sleep 1; done + echo "/var/run/docker.sock is created" +fi + # Generate the docker compose in BTCPAY_DOCKER_COMPOSE . ./build.sh @@ -406,4 +414,9 @@ fi cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker" install_tooling +if $START && [ -x "$(command -v ischroot)" ] && ischroot; then + echo "Killing dockerd in the background..." + kill %- +fi + cd $ORIGINAL_DIRECTORY