Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.git
*.egg-info
deps
jmvenv
jmvenv
compose.yml
Dockerfile
40 changes: 29 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
FROM debian:bookworm-slim

RUN mkdir -p /jm/clientserver
ARG BITCOIN_VERSION=29.2
ARG PYTHON_IMAGE_TAG=3.13-slim-trixie
FROM bitcoin/bitcoin:${BITCOIN_VERSION} AS bitcoin
FROM python:${PYTHON_IMAGE_TAG} AS python
WORKDIR /jm/clientserver

COPY . .

RUN apt-get update && apt-get install -y --no-install-recommends gnupg ca-certificates=* curl=* \
python3-pip=* python3=* \
&& pip3 config set global.break-system-packages true \
&& pip3 install 'wheel>=0.35.1' \
&& ./install.sh --docker-install \
&& apt-get purge -y --autoremove python3-pip \
FROM python AS base-deps
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y --no-install-recommends \
libsecp256k1-2 \
libsodium23 \
openssl \
tor \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM base-deps AS builder
COPY . .
RUN python -m venv jmvenv \
&& . ./jmvenv/bin/activate \
&& pip install -e .[services]

FROM base-deps AS base
COPY --from=builder /jm/clientserver /jm/clientserver
ENTRYPOINT ["./scripts/docker-entrypoint.sh"]

FROM base AS test
ARG BITCOIN_VERSION
COPY --from=bitcoin /opt/bitcoin-${BITCOIN_VERSION}/bin /usr/local/bin/
RUN . ./jmvenv/bin/activate \
&& pip install -e .[test]

FROM base AS joinmarket
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ Alternative to this "quickstart": follow the [install guide](docs/INSTALL.md).
* [Installation guide for Qubes+Whonix](https://github.com/qubenix/qubes-whonix-bitcoin/blob/master/1_joinmarket.md).
* [Youtube video installation tutorial for Ubuntu](https://www.youtube.com/watch?v=zTCC86IUzWo).

### Docker

JoinMarket can be built and run using Docker. To build the Docker image:

docker build -t joinmarket .

To run tests using Docker Compose:

docker compose up test

This will run the full test suite in an isolated environment with all necessary dependencies including Bitcoin Core.

### Usage

If you are new, follow and read the links in the [usage guide](docs/USAGE.md).
Expand Down
18 changes: 18 additions & 0 deletions compose.yml
Copy link
Copy Markdown

@3nprob 3nprob Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: to minimize confusion, indicate that this is intended for tests by e.g. moving to test/Dockerfiles/compose.yml or test/docker-compose.yml.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is meant to be extended at some point, should not be restricted to test imho. Further to that, developer experience feels better to me if you can run all from root folder

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extension can still happen in separate Dockerfiles, no?

Docker is generally "smart" enough to reuse cache layers even if you build from a separate Dockerfile.

Further extending the production Dockerfile and making it more complex without benefiting the runtime image is an antipattern IMO. You can still build and run it from the root directory even if the Dockerfile is in a subdir.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
x-jmbase:
build:
context: .
args:
BITCOIN_VERSION: 29.2
PYTHON_IMAGE_TAG: 3.13-slim-trixie
volumes:
- ./src:/jm/clientserver/src
- ./test:/jm/clientserver/test
- ./scripts:/jm/clientserver/scripts
test:
extends: x-jmbase
image: joinmarket:test
build:
target: test
shm_size: '2gb'
command: ["./test/run_tests.sh", "-v"]
32 changes: 26 additions & 6 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,34 @@ There, you need to install the client code (without Joinmarket's bitcoin):

#### Docker Installation

The [Dockerfile](../Dockerfile) provided builds a minimal Docker image which can help in getting started with a custom Docker setup. An example of building and running the [wallet-tool.py](../scripts/wallet-tool.py) script:
The [Dockerfile](../Dockerfile) provided builds an optimized multi-stage Docker image for JoinMarket. The build process is optimized for layer caching and includes all necessary dependencies.

```
docker build -t joinmarket-test ./
docker run --rm -it joinmarket-test bash -c "cd scripts && python3 wallet-tool.py --help"
```
##### Building the Docker image

To build the production image:

docker build -t joinmarket .

This creates a minimal production image with JoinMarket installed.

##### Running JoinMarket scripts in Docker

Example of running the [wallet-tool.py](../scripts/wallet-tool.py) script:

docker run --rm -it joinmarket python ./scripts/wallet-tool.py --help"

##### Building custom images

The Dockerfile uses multi-stage builds with the following targets:

* `joinmarket` (default) - Production image with JoinMarket installed
* `test` - Testing image that includes Bitcoin Core binaries

You can build a specific target:

docker build --target test -t joinmarket:test .

A new Docker image can be built using `joinmarket-test` as a base using `FROM joinmarket-test`. See [Docker documentation](https://docs.docker.com/engine/reference/builder/) for more details.
See [Docker documentation](https://docs.docker.com/engine/reference/builder/) for more details on multi-stage builds.

#### Development (or making other changes to the code)

Expand Down
17 changes: 17 additions & 0 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
### Test instructions (for developers):

#### Quick start: Running tests with Docker

The easiest way to run the full test suite is using Docker Compose, which handles all dependencies automatically:

docker compose run --rm test

This will:

* Build a Docker image with all dependencies (Python, Bitcoin Core 29.2, miniircd)
* Run the complete test suite in an isolated environment
* Automatically download and set up miniircd
* No need to install bitcoind or other dependencies on your host machine

For development, the Docker setup mounts the `src`, `scripts`, and `test` directories, so you can make changes locally and re-run tests without rebuilding the image.

#### Manual setup

Work in your `jmvenv` virtual environment as for all Joinmarket work. Make sure to have [bitcoind](https://bitcoin.org/en/full-node) 28.1 or newer installed. Also need miniircd installed to the root (i.e. in your `joinmarket-clientserver` directory):

(jmvenv)$ cd /path/to/joinmarket-clientserver
Expand Down
5 changes: 5 additions & 0 deletions scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# shellcheck disable=SC1091
source jmvenv/bin/activate
exec "$@"
Loading