From d79ee283df2f8b701245ba7d5da9a6419664d30d Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 25 Jan 2025 15:54:50 +0100 Subject: [PATCH] change install destination --- CMakeLists.txt | 6 +++--- Dockerfile | 11 ++++++----- Dockerfile.arm64 | 9 +++++---- Dockerfile.rpi | 9 +++++---- Dockerfile.windows | 6 +++--- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c14170f..03875b97 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,9 +352,9 @@ if (NOT APPLE) endif() #cpack -install (TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_PROJECT_NAME}) -install (DIRECTORY html DESTINATION ${CMAKE_PROJECT_NAME}) -install (FILES config.json DESTINATION ${CMAKE_PROJECT_NAME}) +install (TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION bin) +install (DIRECTORY html DESTINATION share/${PROJECT_NAME}) +install (FILES config.json DESTINATION share/${PROJECT_NAME}) SET(CPACK_GENERATOR "TGZ") SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_BUILD_TYPE}) SET(CPACK_PACKAGE_CONTACT "michel.promonet@free.fr") diff --git a/Dockerfile b/Dockerfile index 5a20073f..113e072f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins && cd ../webrtc \ && fetch --nohooks webrtc \ && cd ../webrtc-streamer \ - && cmake -DCMAKE_INSTALL_PREFIX=/app . && make \ + && cmake . && make \ && make install \ && git clean -xfd \ && find ../webrtc/src -type d -name .git -exec rm -rf {} \; || true \ @@ -32,16 +32,17 @@ USER $USERNAME FROM ubuntu:24.04 LABEL maintainer=michel.promonet@free.fr -WORKDIR /app/webrtc-streamer +WORKDIR /usr/local/share/webrtc-streamer -COPY --from=builder /app/ /app/ +COPY --from=builder /usr/local/bin/webrtc-streamer /usr/local/bin/ +COPY --from=builder /usr/local/share/webrtc-streamer/ /usr/local/share/webrtc-streamer/ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libssl-dev libasound2-dev libgtk-3-0 libxtst6 libsm6 libpulse0 librtmp1 avahi-utils \ && useradd -m user -G video,audio \ && apt-get clean && rm -rf /var/lib/apt/lists/ \ - && ./webrtc-streamer -V + && webrtc-streamer -V USER user -ENTRYPOINT [ "./webrtc-streamer" ] +ENTRYPOINT [ "webrtc-streamer" ] CMD [ "-C", "config.json" ] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index baa83aff..740bc2b3 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -14,7 +14,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins && cd ../webrtc \ && fetch --nohooks webrtc \ && cd ../webrtc-streamer \ - && cmake -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ + && cmake -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ && make install \ && rm -rf ../webrtc && rm -f *.a && rm -f src/*.o \ && apt-get clean && rm -rf /var/lib/apt/lists/ @@ -23,9 +23,10 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins FROM --platform=arm64 ubuntu:24.04 LABEL maintainer=michel.promonet@free.fr -WORKDIR /app/webrtc-streamer +WORKDIR /usr/local/share/webrtc-streamer -COPY --from=builder /app/ /app/ +COPY --from=builder /usr/local/bin/webrtc-streamer /usr/local/bin/ +COPY --from=builder /usr/local/share/webrtc-streamer/ /usr/local/share/webrtc-streamer/ -ENTRYPOINT [ "./webrtc-streamer" ] +ENTRYPOINT [ "webrtc-streamer" ] CMD [ "-a", "-C", "config.json" ] diff --git a/Dockerfile.rpi b/Dockerfile.rpi index 37ba70c7..93e431d1 100644 --- a/Dockerfile.rpi +++ b/Dockerfile.rpi @@ -21,7 +21,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins && cd ../webrtc \ && fetch --nohooks webrtc \ && cd ../webrtc-streamer \ - && cmake -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ + && cmake -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ && make install \ && rm -rf ../webrtc && rm -f *.a && rm -f src/*.o \ && apt-get clean && rm -rf /var/lib/apt/lists/ @@ -30,9 +30,10 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins FROM $IMAGE LABEL maintainer=michel.promonet@free.fr -WORKDIR /app/webrtc-streamer +WORKDIR /usr/local/share/webrtc-streamer -COPY --from=builder /app/ /app/ +COPY --from=builder /usr/local/bin/webrtc-streamer /usr/local/bin/ +COPY --from=builder /usr/local/share/webrtc-streamer/ /usr/local/share/webrtc-streamer/ -ENTRYPOINT [ "./webrtc-streamer" ] +ENTRYPOINT [ "webrtc-streamer" ] CMD [ "-a", "-C", "config.json" ] diff --git a/Dockerfile.windows b/Dockerfile.windows index 00831e45..e8cfd503 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -47,12 +47,12 @@ RUN powershell -c "sleep -Seconds 60" && time /t FROM mcr.microsoft.com/windows/server:ltsc2022 LABEL maintainer=michel.promonet@free.fr -WORKDIR /app/webrtc-streamer +WORKDIR /app/share/webrtc-streamer COPY --from=builder /app/ /app/ RUN dir /w && set -RUN webrtc-streamer.exe -V +RUN /app/bin/webrtc-streamer.exe -V -ENTRYPOINT [ "webrtc-streamer.exe" ] +ENTRYPOINT [ "/app/bin/webrtc-streamer.exe" ] CMD [ "-a", "-C", "config.json" ]