A Dockerfile for the Python 2 pywallet tool
This guide provides instructions on how to build and run the pywallet
application within a Docker container. Pywallet
is a Python tool used for managing Bitcoin wallet files.
Before you begin, ensure that Docker is installed on your system. If not, follow the installation instructions for your respective operating system on the Docker website or vpsbg.eu.
To build the Docker image, perform the following steps:
- Open a terminal.
- Navigate to the directory containing the Dockerfile (where this repo was cloned).
- Run the following command to build the Docker image:
docker build -t pywallet-image .
This command builds an image named pywallet-image
using the Dockerfile in the current directory.
To run the pywallet
application within the Docker container, use the following command:
docker run --rm -it pywallet-image [arguments]
Replace [arguments]
with the actual arguments you want to pass to pywallet.py
.
To display the help information for pywallet.py
, run:
docker run --rm -it pywallet-image --help
If you need to work with wallet files located on your local file system, you must mount the directory containing the files into the Docker container. Use the following command structure:
docker run --rm -it -v /path/to/local/directory:/pywallet/data pywallet-image --datadir=/pywallet/data --dumpwallet
Replace /path/to/local/directory
with the path to the directory on your local machine where your wallet files are stored.
To recover a wallet using a wallet.dat file located on your local system:
docker run --rm -it -v /path/to/local/directory:/pywallet/data pywallet-image --datadir=/pywallet/data --recover --recov_device=/pywallet/data/wallet.dat --recov_size=20Mio
Make sure to replace /path/to/local/directory
with the actual path where your wallet.dat
file is stored and adjust the --recov_size
argument according to the estimated size of your wallet.
docker run --rm -it pywallet-image --tests
- When mounting volumes (
-v
option), the path specified in the container (e.g.,/pywallet/data
) must correspond to the expected data directory path used within thepywallet.py
application. - Ensure that you use absolute paths both for the local directory on your host and within the container to avoid path resolution issues.