Skip to content

Commit

Permalink
Merge pull request #130 from waybackarchiver/podman
Browse files Browse the repository at this point in the history
Allow building using podman
  • Loading branch information
mihaiplesa committed Feb 21, 2024
2 parents 1b7129c + cb1a8ab commit 6235948
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions build_linux_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions build_mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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"
2 changes: 2 additions & 0 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

0 comments on commit 6235948

Please sign in to comment.