Skip to content

Commit 0c161f1

Browse files
committed
move tank dockerfiles to images/bitcoin
1 parent 992219a commit 0c161f1

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

src/warnet/templates/Dockerfile renamed to images/bitcoin/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ RUN --mount=type=cache,target=/var/cache/apk \
2222
sqlite-dev \
2323
zeromq-dev
2424

25-
COPY src/warnet/templates/isroutable.patch /tmp/
26-
COPY src/warnet/templates/addrman.patch /tmp/
25+
COPY images/bitcoin/isroutable.patch /tmp/
26+
COPY images/bitcoin/addrman.patch /tmp/
2727

2828

2929
# Clone and patch and build stage
@@ -77,8 +77,7 @@ RUN --mount=type=cache,target=/var/cache/apk sed -i 's/http\:\/\/dl-cdn.alpineli
7777
su-exec
7878

7979
COPY --from=build /opt/bitcoin /usr/local
80-
COPY src/warnet/templates/entrypoint.sh /entrypoint.sh
81-
COPY src/warnet/templates/tor/torrc /etc/tor/warnet-torr
80+
COPY images/bitcoin/entrypoint.sh /
8281

8382
VOLUME ["/home/bitcoin/.bitcoin"]
8483
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/warnet/cli/image_build.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import importlib.resources
1+
import os
22
import subprocess
3+
from pathlib import Path
34

45
ARCHES = ["amd64", "arm64", "armhf"]
56

7+
dockerfile_path = Path(os.path.dirname(os.path.abspath(__file__))) / ".." / ".." / ".." / "images" / "bitcoin" / "Dockerfile"
68

79
def run_command(command):
810
try:
@@ -44,15 +46,6 @@ def build_image(
4446
print(f"{build_args=:}")
4547
print(f"{build_arches=:}")
4648

47-
# Use importlib.resources to check if the templates directory exists
48-
template_package = "warnet.templates"
49-
with importlib.resources.path(template_package, "Dockerfile") as dockerfile_path:
50-
dockerfile_dir = dockerfile_path.parent
51-
if not dockerfile_dir.is_dir():
52-
print("Directory src/warnet/templates does not exist.")
53-
print("Please run this script from the project root.")
54-
return False
55-
5649
# Setup buildkit
5750
builder_name = "bitcoind-builder"
5851
create_builder_cmd = f"docker buildx create --name {builder_name} --use"

0 commit comments

Comments
 (0)