# $GOURDES miner image: the client from https://gourdes.finance/miner/ with Python and its packages.
# Mines on NVIDIA cards (docker run --gpus all, needs the NVIDIA Container Toolkit) and on the processor
# through PoCL (an OpenCL driver for processors, bundled with the pyopencl package), so it also runs on
# machines without a graphics card.
FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends tini binutils libgcc-14-dev libc6-dev && rm -rf /var/lib/apt/lists/* \
 && mkdir -p /etc/OpenCL/vendors && echo libnvidia-opencl.so.1 > /etc/OpenCL/vendors/nvidia.icd
COPY requirements.txt /app/requirements.txt
# pocl-binary-distribution places the PoCL processor driver next to pyopencl's OpenCL loader
RUN pip install --no-cache-dir -r /app/requirements.txt tzdata==2026.6 pocl-binary-distribution==3.0
COPY run.py gminer.py msolver.py keccak.cl config.example.json GourdesMiner.abi.json gourdes_start.py /app/
# HOME=/tmp: the OpenCL compilers keep their cache there, and the image runs as any --user id
ENV NVIDIA_VISIBLE_DEVICES=all NVIDIA_DRIVER_CAPABILITIES=compute,utility GOURDES_DATA=/data PYTHONUNBUFFERED=1 HOME=/tmp
WORKDIR /data
ENTRYPOINT ["tini", "--", "python", "/app/gourdes_start.py"]
CMD ["mine"]
