-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile
75 lines (66 loc) · 1.85 KB
/
Dockerfile
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM ubuntu:22.04 AS builder
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y upgrade \
&& apt-get install -y \
apt-utils \
git \
cmake \
automake \
libtool \
build-essential \
libminiupnpc-dev \
libjemalloc-dev \
zlib1g-dev \
libzstd-dev \
ocl-icd-opencl-dev \
ccache \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN git submodule update --init --recursive
RUN --mount=type=cache,target=/root/.cache/ccache sh make_release.sh "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
FROM ubuntu:22.04 AS base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y upgrade \
&& apt-get install -y \
apt-utils \
curl \
libminiupnpc17 \
libjemalloc2 \
zlib1g \
libzstd1 \
libgomp1 \
ocl-icd-libopencl1 \
tzdata \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/build/dist ./
COPY ["docker-entrypoint.sh", "./"]
ENV MMX_HOME="/data/"
VOLUME /data
# node p2p port
EXPOSE 12342/tcp
# http api port
EXPOSE 11380/tcp
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["./run_node.sh"]
FROM base AS amd
ARG AMD_DRIVER=amdgpu-install_5.4.50400-1_all.deb
ARG AMD_DRIVER_URL=https://repo.radeon.com/amdgpu-install/5.4/ubuntu/jammy
RUN mkdir -p /tmp/opencl-driver-amd \
&& cd /tmp/opencl-driver-amd \
&& curl --referer $AMD_DRIVER_URL -O $AMD_DRIVER_URL/$AMD_DRIVER \
&& dpkg -i $AMD_DRIVER \
&& rm -rf /tmp/opencl-driver-amd
RUN apt-get update && apt-get -y upgrade \
&& apt-get install -y \
rocm-opencl \
&& rm -rf /var/lib/apt/lists/*
FROM base AS nvidia
RUN mkdir -p /etc/OpenCL/vendors \
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
FROM base AS intel
RUN apt-get update && apt-get install --no-install-recommends -y intel-opencl-icd \
&& rm -rf /var/lib/apt/lists/*