diff --git a/build_linux.sh b/build_linux.sh index 0c69808..5bd715a 100755 --- a/build_linux.sh +++ b/build_linux.sh @@ -5,12 +5,12 @@ DOCKERFILE="Dockerfile-linux" cleanup () { echo "cleaning up docker containers/images" - docker rm -f "$IMAGE_NAME" || true - docker rmi -f "$IMAGE_NAME" || true + "$DOCKER" rm -f "$IMAGE_NAME" || true + "$DOCKER" rmi -f "$IMAGE_NAME" || true } cleanup -docker build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ +"$DOCKER" build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ --build-arg "tor_version=$TOR_VERSION" \ --build-arg "zlib_version=$ZLIB_VERSION" \ --build-arg "libevent_version=$LIBEVENT_VERSION" \ @@ -20,8 +20,8 @@ docker build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ --build-arg "openssl_hash=$OPENSSL_HASH" \ --build-arg "tor_hash=$TOR_HASH" \ ${1+"$@"} . -docker run --init --rm --name "$IMAGE_NAME" -d "$IMAGE_NAME" -docker cp "$IMAGE_NAME:/tor-$TOR_VERSION/install/bin/tor" "tor-$TOR_VERSION-linux-brave-$BRAVE_TOR_VERSION" +"$DOCKER" run --init --rm --name "$IMAGE_NAME" -d "$IMAGE_NAME" +"$DOCKER" cp "$IMAGE_NAME:/tor-$TOR_VERSION/install/bin/tor" "tor-$TOR_VERSION-linux-brave-$BRAVE_TOR_VERSION" if ! ldd "tor-$TOR_VERSION-linux-brave-$BRAVE_TOR_VERSION" 2>&1 \ | grep -F -q 'not a dynamic executable'; then diff --git a/build_linux_arm64.sh b/build_linux_arm64.sh index 9092fc2..6749532 100755 --- a/build_linux_arm64.sh +++ b/build_linux_arm64.sh @@ -5,12 +5,12 @@ DOCKERFILE="Dockerfile-linux-arm64" cleanup () { echo "cleaning up docker containers/images" - docker rm -f "$IMAGE_NAME" || true - docker rmi -f "$IMAGE_NAME" || true + "$DOCKER" rm -f "$IMAGE_NAME" || true + "$DOCKER" rmi -f "$IMAGE_NAME" || true } cleanup -docker build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ +"$DOCKER" build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ --build-arg "tor_version=$TOR_VERSION" \ --build-arg "zlib_version=$ZLIB_VERSION" \ --build-arg "libevent_version=$LIBEVENT_VERSION" \ @@ -20,8 +20,8 @@ docker build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ --build-arg "openssl_hash=$OPENSSL_HASH" \ --build-arg "tor_hash=$TOR_HASH" \ ${1+"$@"} . -docker run --init --rm --name "$IMAGE_NAME" -d "$IMAGE_NAME" -docker cp "$IMAGE_NAME:/tor-$TOR_VERSION/install/bin/tor" "tor-$TOR_VERSION-linux-arm64-brave-$BRAVE_TOR_VERSION" +"$DOCKER" run --init --rm --name "$IMAGE_NAME" -d "$IMAGE_NAME" +"$DOCKER" cp "$IMAGE_NAME:/tor-$TOR_VERSION/install/bin/tor" "tor-$TOR_VERSION-linux-arm64-brave-$BRAVE_TOR_VERSION" if ! ldd "tor-$TOR_VERSION-linux-arm64-brave-$BRAVE_TOR_VERSION" 2>&1 \ | grep -F -q 'not a dynamic executable'; then diff --git a/build_mingw.sh b/build_mingw.sh index cf2feaf..04d451a 100755 --- a/build_mingw.sh +++ b/build_mingw.sh @@ -5,12 +5,12 @@ DOCKERFILE="Dockerfile-mingw" cleanup () { echo "cleaning up docker containers/images" - docker rm -f "$IMAGE_NAME" || true - docker rmi -f "$IMAGE_NAME" || true + "$DOCKER" rm -f "$IMAGE_NAME" || true + "$DOCKER" rmi -f "$IMAGE_NAME" || true } cleanup -docker build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ +"$DOCKER" build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ --build-arg "tor_version=$TOR_VERSION" \ --build-arg "zlib_version=$ZLIB_VERSION" \ --build-arg "libevent_version=$LIBEVENT_VERSION" \ @@ -20,5 +20,5 @@ docker build --no-cache -t "$IMAGE_NAME" -f "$DOCKERFILE" \ --build-arg "openssl_hash=$OPENSSL_HASH" \ --build-arg "tor_hash=$TOR_HASH" \ ${1+"$@"} . -docker run --init --rm --name "$IMAGE_NAME" -d "$IMAGE_NAME" -docker cp "$IMAGE_NAME:/tor-$TOR_VERSION/install/bin/tor.exe" "tor-$TOR_VERSION-win32-brave-$BRAVE_TOR_VERSION.exe" +"$DOCKER" run --init --rm --name "$IMAGE_NAME" -d "$IMAGE_NAME" +"$DOCKER" cp "$IMAGE_NAME:/tor-$TOR_VERSION/install/bin/tor.exe" "tor-$TOR_VERSION-win32-brave-$BRAVE_TOR_VERSION.exe" diff --git a/env.sh b/env.sh index 0014bb2..0429bb2 100755 --- a/env.sh +++ b/env.sh @@ -15,3 +15,5 @@ export ZLIB_HASH="9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df export LIBEVENT_HASH=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb export OPENSSL_HASH=cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 export TOR_HASH="e628b4fab70edb4727715b23cf2931375a9f7685ac08f2c59ea498a178463a86" + +export DOCKER="$(command -v docker || command -v podman)" \ No newline at end of file