-
Notifications
You must be signed in to change notification settings - Fork 245
/
Copy pathDockerfile-centos8
47 lines (35 loc) · 1.75 KB
/
Dockerfile-centos8
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
# Use docker build --build-arg AUDIOWAVEFORM_VERSION=<git-revision>
# --build-arg AUDIOWAVEFORM_PACKAGE_VERSION=<version>
# --build-arg CENTOS_RELEASE=<release>
# --build-arg ARCH=<x86_64|aarch64>
FROM centos:8
ARG AUDIOWAVEFORM_VERSION
ARG AUDIOWAVEFORM_PACKAGE_VERSION
ARG CENTOS_RELEASE
ARG ARCH
# Use the epel repository (to provide the libmad package)
# Centos 8 reached End Of Life on December 31, 2021
# https://stackoverflow.com/questions/71066213
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN yum update -y
RUN INSTALL_PKGS="epel-release" && \
yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && rpm -V ${INSTALL_PKGS} && \
yum clean all -y
RUN yum install -y dnf-plugins-core && \
yum config-manager --set-enabled powertools
# Install audiowaveform build dependencies
RUN INSTALL_PKGS="rpm-build wget make cmake gcc-c++ libmad-devel libid3tag-devel libsndfile-devel gd-devel boost-devel" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \
yum clean all -y
# Retrieve and build source (see https://github.com/bbc/audiowaveform#building-from-source)
WORKDIR /root
RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSION}.tar.gz | tar xfz - && \
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
mkdir build && \
cd build && \
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
make && \
cpack -G RPM
WORKDIR /root/audiowaveform-${AUDIOWAVEFORM_VERSION}/build
RUN mv audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.${ARCH}.rpm audiowaveform-${AUDIOWAVEFORM_PACKAGE_VERSION}-1.el${CENTOS_RELEASE}.${ARCH}.rpm