-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathContainerfile
49 lines (36 loc) · 1.97 KB
/
Containerfile
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
FROM registry.fedoraproject.org/fedora:latest as builder
MAINTAINER "Robert Bohne" [email protected]
ARG V4L2LOOPBACK_KERNEL_VERSION
ARG V4L2LOOPBACK_VERSION
ARG V4L2LOOPBACK_SHA256
# 0.12.5 -> e152cd6df6a8add172fb74aca3a9188264823efa5a2317fe960d45880b9406ae
# 0.12.7 -> e0782b8abe8f2235e2734f725dc1533a0729e674c4b7834921ade43b9f04939b
# 0.13.2 -> 1e57e1e382d7451aa2a88d63cc9f146eab1f425b90e76104d4c3d73127e34771
WORKDIR /tmp
# Install koji and use to pull kernel packages based on V4L2LOOPBACK_KERNEL_VERSION
RUN dnf install -y koji && \
mkdir /tmp/koji && \
cd /tmp/koji && \
koji download-build --arch=x86_64 kernel-${V4L2LOOPBACK_KERNEL_VERSION::-7}
RUN cd /tmp/koji && \
dnf install -y \
gc gcc glibc-devel glibc-headers \
./kernel-modules-core-${V4L2LOOPBACK_KERNEL_VERSION}.rpm ./kernel-core-${V4L2LOOPBACK_KERNEL_VERSION}.rpm ./kernel-devel-${V4L2LOOPBACK_KERNEL_VERSION}.rpm ./kernel-modules-${V4L2LOOPBACK_KERNEL_VERSION}.rpm && \
dnf clean all -y
RUN curl -LS https://github.com/umlaeute/v4l2loopback/archive/v${V4L2LOOPBACK_VERSION}.tar.gz| \
{ t="$(mktemp)"; trap "rm -f '$t'" INT TERM EXIT; cat >| "$t"; sha256sum --quiet -c <<<"${V4L2LOOPBACK_SHA256} $t" \
|| exit 1; cat "$t"; } | tar xzf -
RUN cd /tmp/v4l2loopback-${V4L2LOOPBACK_VERSION}; \
make -j$(nproc) && make install
FROM registry.fedoraproject.org/fedora:latest
MAINTAINER "Robert Bohne" [email protected]
ARG V4L2LOOPBACK_VERSION
ARG V4L2LOOPBACK_KERNEL_VERSION
WORKDIR /tmp
COPY --from=builder /tmp/koji/ /tmp/koji/
RUN cd /tmp/koji && \
dnf install -y ./kernel-modules-core-${V4L2LOOPBACK_KERNEL_VERSION}.rpm ./kernel-core-${V4L2LOOPBACK_KERNEL_VERSION}.rpm ./kernel-devel-${V4L2LOOPBACK_KERNEL_VERSION}.rpm ./kernel-modules-${V4L2LOOPBACK_KERNEL_VERSION}.rpm v4l-utils && \
rm -rf /tmp/koji
COPY --from=builder /tmp/v4l2loopback-${V4L2LOOPBACK_VERSION}/v4l2loopback.ko \
/usr/lib/modules/${V4L2LOOPBACK_KERNEL_VERSION}/extra/v4l2loopback.ko
CMD /usr/bin/v4l2-ctl