我将以多阶段构建的方式构建图像。
您可以在此处找到Docker映像
https://github.com/joergklein/docker-svxlink
https://hub.docker.com/r/joergklein/svxlink
hub.docker.com上的Docker镜像工作正常。下面的Dockerfile是下一步文本
The Error Messages is:
Run CPack packaging tool...
CPack: Create package using RPM
CPack: Install projects
CPack: - Run preinstall target for: svxlink
CPack: - Install project: svxlink
CPack: Create package
CPackRPM:Warning: CPACK_SET_DESTDIR is set (=ON) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.
CPackRPM: Will use GENERATED spec file: /usr/src/svxlink-master/src/_CPack_Packages/Linux/RPM/SPECS/svxlink.spec
CPack: - package: /usr/src/svxlink-master/src/svxlink-master-Linux.rpm generated.
这是Dockerfile。
FROM centos:latest as builder
LABEL maintainer="" \
description="Docker base image for SvxLink (Echolink)"
RUN dnf update -y \
&& dnf --enablerepo=PowerTools install -y doxygen gsm-devel groff libsigc++20-devel opus-devel speex-devel qt5-devel.noarch \
&& dnf install -y alsa-utils alsa-lib-devel bzip2 cmake make gcc gcc-c++ libgcrypt-devel libcurl-devel mesa-dri-drivers popt-devel rpm-build tcl-devel zip \
&& dnf install -y epel-release \
&& dnf install -y jsoncpp-devel \
&& dnf clean all \
&& rm -rf /var/cache/dnf
# Download the source file
ENV VERSION master
ENV BINARY ${VERSION}.zip
RUN curl -LJO https://github.com/sm0svx/svxlink/archive/${BINARY} \
&& unzip svxlink-${BINARY} -d /usr/src/ \
# && tar xzf svxlink-${BINARY} -C /usr/src/ \
&& rm svxlink-${BINARY}
# Download the sound files
RUN mkdir -p /usr/share/svxlink/sounds \
&& cd /usr/share/svxlink/sounds \
&& curl -LJO https://github.com/sm0svx/svxlink-sounds-en_US-heather/releases/download/19.09/svxlink-sounds-en_US-heather-16k-19.09.tar.bz2 \
&& tar xvaf svxlink-sounds-* \
&& ln -sf en_US-heather-16k en_US \
&& rm svxlink-sounds-*
# Create user svxlink
RUN groupadd svxlink
RUN useradd -r -g daemon -G svxlink -c "SvxLink" svxlink
# Set workdir to compile the source code
WORKDIR /usr/src/svxlink-${VERSION}/src
# Build and install svxlink
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc -DLOCAL_STATE_DIR=/var -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR="RPM" .
RUN make && make doc && make install && make package
RUN ldconfig
# Make the image
FROM centos:latest
RUN dnf update -y \
&& dnf clean all \
&& rm -rf /var/cache/dnf
COPY --from=builder /usr/src/svxlink-master/src/svxlink-master-Linux.rpm /root/svxlink-master-Linux.rpm
RUN dnf install -y root/svxlink-master-Linux.rpm
# Set workdir to /root
WORKDIR /root
# Create user svxlink
RUN groupadd svxlink
RUN useradd -r -g daemon -G svxlink -c "SvxLink" svxlink
# CMD ["./svxlink"]