|
1 | | -# Copyright (C) 2018 Christian Berger |
| 1 | +# Copyright (C) 2022 Christian Berger |
2 | 2 | # |
3 | 3 | # This program is free software: you can redistribute it and/or modify |
4 | 4 | # it under the terms of the GNU General Public License as published by |
|
14 | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
|
16 | 16 | # Part to build opendlv-video-h264-decoder. |
17 | | -FROM ubuntu:18.04 as builder |
| 17 | +FROM ubuntu:20.04 as builder |
18 | 18 | MAINTAINER Christian Berger "christian.berger@gu.se" |
| 19 | +ENV DEBIAN_FRONTEND=noninteractive |
19 | 20 | RUN apt-get update -y && \ |
20 | 21 | apt-get upgrade -y && \ |
21 | 22 | apt-get dist-upgrade -y && \ |
22 | 23 | apt-get install -y --no-install-recommends \ |
23 | 24 | ca-certificates \ |
24 | 25 | cmake \ |
25 | | - build-essential \ |
| 26 | + make \ |
| 27 | + linux-headers-generic \ |
26 | 28 | git \ |
27 | 29 | libx11-dev \ |
28 | 30 | nasm \ |
| 31 | + clang \ |
29 | 32 | wget |
30 | 33 | RUN cd tmp && \ |
31 | 34 | git clone https://chromium.googlesource.com/libyuv/libyuv && \ |
32 | 35 | cd libyuv &&\ |
33 | | - git checkout -b working 2525698acba9bf9b701ba6b4d9584291a1f62257 && \ |
34 | | - make -f linux.mk libyuv.a && cp libyuv.a /usr/lib/x86_64-linux-gnu && cd include && cp -r * /usr/include |
| 36 | + git checkout -b working eb6e7bb63738e29efd82ea3cf2a115238a89fa51 && \ |
| 37 | + make -f linux.mk CXX=clang++ libyuv.a && if [ `uname -m` = aarch64 ] ; then cp libyuv.a /usr/lib/aarch64-linux-gnu ; else cp libyuv.a /usr/lib/x86_64-linux-gnu ; fi && cd include && cp -r * /usr/include |
35 | 38 | RUN cd tmp && \ |
36 | | - git clone --depth 1 --branch v2.0.0 https://github.com/cisco/openh264.git && \ |
37 | | - cd openh264 && mkdir b && cd b \ |
38 | | - make -j2 -f ../Makefile libraries && make -f ../Makefile install |
| 39 | + git clone --depth 1 --branch v2.2.0 https://github.com/cisco/openh264.git && \ |
| 40 | + cd openh264 && mkdir b && cd b && \ |
| 41 | + ln -sf /usr/bin/clang++-10 /usr/bin/g++ && \ |
| 42 | + ln -sf /usr/bin/clang-10 /usr/bin/cc && \ |
| 43 | + if [ `uname -m` = aarch64 ] ; then make ARCH=arm64 -j2 -f ../Makefile libraries ; else make -j2 -f ../Makefile libraries ; fi && make -f ../Makefile install |
39 | 44 | ADD . /opt/sources |
40 | 45 | WORKDIR /opt/sources |
41 | 46 | RUN mkdir build && \ |
42 | 47 | cd build && \ |
43 | 48 | cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/tmp .. && \ |
44 | 49 | make && make install |
45 | | -RUN cd /tmp && wget http://ciscobinary.openh264.org/libopenh264-2.0.0-linux64.5.so.bz2 |
| 50 | +RUN cd /tmp && if [ `uname -m` = aarch64 ] ; then wget http://ciscobinary.openh264.org/libopenh264-2.2.0-linux-arm64.6.so.bz2 && mv libopenh264-2.2.0-linux-arm64.6.so.bz2 libopenh264.so.6.bz2 ; else wget http://ciscobinary.openh264.org/libopenh264-2.2.0-linux64.6.so.bz2 && mv libopenh264-2.2.0-linux64.6.so.bz2 libopenh264.so.6.bz2 ; fi |
46 | 51 |
|
47 | 52 | # Part to deploy opendlv-video-h264-decoder. |
48 | | -FROM ubuntu:18.04 |
| 53 | +FROM ubuntu:20.04 |
49 | 54 | MAINTAINER Christian Berger "christian.berger@gu.se" |
50 | 55 |
|
51 | 56 | RUN apt-get update -y && \ |
52 | 57 | apt-get upgrade -y && \ |
53 | 58 | apt-get dist-upgrade -y && \ |
54 | 59 | apt-get install -y --no-install-recommends libx11-6 |
55 | 60 |
|
56 | | -WORKDIR /usr/lib/x86_64-linux-gnu |
57 | | -COPY --from=builder /tmp/libopenh264-2.0.0-linux64.5.so.bz2 . |
58 | | -RUN bunzip2 libopenh264-2.0.0-linux64.5.so.bz2 && \ |
59 | | - ln -sf libopenh264-2.0.0-linux64.5.so libopenh264.so.5 |
| 61 | +WORKDIR /tmp |
| 62 | +COPY --from=builder /tmp/libopenh264.so.6.bz2 . |
| 63 | +RUN bunzip2 libopenh264.so.6.bz2 && \ |
| 64 | + if [ `uname -m` = aarch64 ] ; then mv /tmp/libopenh264.so.6 /usr/lib/aarch64-linux-gnu/libopenh264.so.6 ; else mv /tmp/libopenh264.so.6 /usr/lib/x86_64-linux-gnu/libopenh264.so.6 ; fi |
60 | 65 |
|
61 | 66 | WORKDIR /usr/bin |
62 | 67 | COPY --from=builder /tmp/bin/opendlv-video-h264-decoder . |
63 | 68 | ENTRYPOINT ["/usr/bin/opendlv-video-h264-decoder"] |
64 | | - |
|
0 commit comments