-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
103 lines (93 loc) · 3.49 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
ARG OUTPUT=/output
FROM alpine:edge AS builder
RUN apk add --no-cache \
autoconf \
automake \
binutils \
cmake \
curl \
dpkg \
file \
g++ \
gcc \
git \
libc6-compat \
libdrm-dev \
libtool \
libxshmfence \
linux-headers \
make \
mesa-va-gallium \
musl-dev \
nghttp2-dev \
pkgconfig \
xxd
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FROM builder AS amd
ARG CFLAGS
ARG LDFLAGS
ARG MAKEFLAGS
ARG OUTPUT
ARG DESTDIR
WORKDIR /tmp/amd
RUN ls -la /usr/lib/
RUN apk add xf86-video-amdgpu linux-firmware-amdgpu --no-cache --update-cache \
&& apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libva-utils \
&& mkdir -p "$OUTPUT/usr/bin" \
&& cp -a /usr/bin/vainfo "$OUTPUT/usr/bin" \
&& mkdir -p "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libX*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libwayland*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libva*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libdrm*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libbsd*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libxshmfence*.so* "$OUTPUT/usr/lib" \
# && cp -a /usr/lib/libkms*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libxcb*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libffi*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libLLVM*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libzstd*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libexpat*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libelf*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libstdc++*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libgcc_s*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libmd*.so* "$OUTPUT/usr/lib" \
&& cp -a /usr/lib/libxml2*.so* "$OUTPUT/usr/lib" \
&& mkdir -p "$OUTPUT/usr/lib/dri" \
&& cp -a /usr/lib/dri/*.so* "$OUTPUT/usr/lib/dri" \
&& mkdir -p "$OUTPUT/usr/share/libdrm" \
&& cp -a /usr/share/libdrm/* "$OUTPUT/usr/share/libdrm" \
&& cp -a /lib/ld-musl-x86_64.so.1 "$OUTPUT/usr/lib" \
&& cp -a /lib/libz*.so* "$OUTPUT/usr/lib"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from ghcr.io/linuxserver/plex:latest
ARG OUTPUT
# Install AMD drivers
RUN apt-get update \
&& apt-get install -y software-properties-common
RUN add-apt-repository ppa:oibaf/graphics-drivers -y
RUN curl -sL --retry 3 https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \
&& add-apt-repository "deb https://repo.radeon.com/rocm/apt/latest $(lsb_release -s -c) main" -y
RUN apt-get update \
&& apt-get install -y \
vainfo \
mesa-va-drivers \
mesa-vdpau-drivers \
libdrm-amdgpu1 \
libavutil58 \
rocm-opencl-runtime \
&& apt-get clean
# Copy lib files
COPY --from=amd $OUTPUT/usr/lib/dri/*.so* /usr/lib/plexmediaserver/lib/dri/
COPY --from=amd $OUTPUT/usr/lib/ld-musl-x86_64.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libdrm*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libelf*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libffi*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libgcc_s*.so* /usr/lib/plexmediaserver/lib/
# COPY --from=amd $OUTPUT/usr/lib/libkms*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libLLVM*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libstdc++*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libva*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libxml2*.so* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libz*.so.* /usr/lib/plexmediaserver/lib/
COPY --from=amd $OUTPUT/usr/lib/libzstd*.so* /usr/lib/plexmediaserver/lib/