forked from 1inch/profanity2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (45 loc) · 2.15 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (45 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# syntax=docker/dockerfile:1
# ---------------------------------------------------------------------------
# Build stage
# ---------------------------------------------------------------------------
FROM ubuntu:24.04 AS build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
opencl-headers \
ocl-icd-opencl-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY Makefile ./
COPY *.cpp *.hpp *.cl ./
RUN make -j"$(nproc)"
# ---------------------------------------------------------------------------
# Runtime stage
# ---------------------------------------------------------------------------
FROM ubuntu:24.04
LABEL org.opencontainers.image.title="profanity2" \
org.opencontainers.image.description="GPU vanity address generator for Ethereum (OpenCL)" \
org.opencontainers.image.source="https://github.com/1inch/profanity2" \
org.opencontainers.image.licenses="MIT"
# ocl-icd-libopencl1 is the ICD loader the binary links against, clinfo is kept
# for diagnosing "no devices found" on rented machines.
RUN apt-get update && apt-get install -y --no-install-recommends \
ocl-icd-libopencl1 \
clinfo \
&& rm -rf /var/lib/apt/lists/*
# The NVIDIA container runtime mounts libnvidia-opencl.so.1 into the container
# but does not register it with the ICD loader, so the vendor file has to be
# part of the image:
# https://github.com/NVIDIA/nvidia-container-toolkit/issues/682
RUN mkdir -p /etc/OpenCL/vendors \
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# compute enables the OpenCL driver libraries, utility enables nvidia-smi.
ENV NVIDIA_VISIBLE_DEVICES=all \
NVIDIA_DRIVER_CAPABILITIES=compute,utility
# profanity2 loads keccak.cl/profanity.cl and stores its compiled kernel cache
# relative to the working directory, so the binary has to run from here.
WORKDIR /opt/profanity2
COPY --from=build /src/profanity2.x64 /src/keccak.cl /src/profanity.cl ./
COPY LICENSE ./
COPY docker/entrypoint.sh /usr/local/bin/profanity2-entrypoint
RUN chmod +x /usr/local/bin/profanity2-entrypoint && mkdir -p /workspace
ENTRYPOINT ["/usr/local/bin/profanity2-entrypoint"]