diff --git a/.github/actions/build-cpp/Dockerfile b/.github/actions/build-cpp/Dockerfile index ebd1ec0d0..a3586b2d0 100644 --- a/.github/actions/build-cpp/Dockerfile +++ b/.github/actions/build-cpp/Dockerfile @@ -1,6 +1,6 @@ -FROM debian:bookworm-slim +FROM ubuntu:noble -ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3 python3-pip python3-setuptools ca-certificates libasan6 zip curl wget" +ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3 python3-pip python3-setuptools ca-certificates zip curl wget gcc-aarch64-linux-gnu g++-aarch64-linux-gnu" COPY ./entrypoint.sh /entrypoint.sh diff --git a/.github/actions/build-cpp/action.yml b/.github/actions/build-cpp/action.yml index 8b7d858f4..8028b0f18 100644 --- a/.github/actions/build-cpp/action.yml +++ b/.github/actions/build-cpp/action.yml @@ -33,6 +33,11 @@ inputs: required: true default: "ON" + arch: + description: "arch" + required: true + default: "amd64" + file: description: "Dockerfile used to build the image" required: true diff --git a/.github/actions/build-cpp/entrypoint.sh b/.github/actions/build-cpp/entrypoint.sh index fd7a5eb4f..897aa2be8 100644 --- a/.github/actions/build-cpp/entrypoint.sh +++ b/.github/actions/build-cpp/entrypoint.sh @@ -13,16 +13,40 @@ function build() { cp -rf /github/workspace/3rd/ /pktvisor-src/3rd/ cp -rf /github/workspace/libs/ /pktvisor-src/libs/ cp -rf /github/workspace/docker/ /pktvisor-src/docker/ - cp -rf /github/workspace/golang/ /pktvisor-src/golang/ cp -rf /github/workspace/build/ /pktvisor-src/build/ + cp -rf /github/workspace/golang/ /pktvisor-src/golang/ cp -rf /github/workspace/integration_tests/ /pktvisor-src/integration_tests/ cp -rf /github/workspace/cmake/ /pktvisor-src/cmake/ cp -rf /github/workspace/CMakeLists.txt /pktvisor-src/ cp -rf /github/workspace/conanfile.py /pktvisor-src/ - cd /pktvisor-src/build/ + cp -rf /github/workspace/.conanrc /pktvisor-src/ + cd /pktvisor-src/ conan profile detect -f - PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN .. - make all -j 4 + cd /pktvisor-src/build/ + if [ "$INPUT_ARCH" == "amd64" ]; then + PKG_CONFIG_PATH=/local/lib/pkgconfig cmake .. -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE \ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN + elif [ "$INPUT_ARCH" == "arm64" ]; then + echo "[settings] + os=Linux + arch=armv8 + compiler=gcc + compiler.version=13 + compiler.cppstd=17 + compiler.libcxx=libstdc++11 + build_type=$INPUT_BUILD_TYPE + [buildenv] + CC=/usr/bin/aarch64-linux-gnu-gcc + CXX=/usr/bin/aarch64-linux-gnu-g++ + " | tee "$(conan config home)/profiles/host" + conan install .. --profile host --build missing + source $INPUT_BUILD_TYPE/generators/conanbuild.sh + PKG_CONFIG_PATH=/local/lib/pkgconfig cmake .. -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE \ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN \ + -DCONAN_HOST_PROFILE="host" -DCORRADE_RC_PROGRAM=$(command -v corrade-rc) \ + -DCONAN_INSTALL_ARGS=--build=never + fi + cmake --build . --config $INPUT_BUILD_TYPE -- -j 4 } function move() { @@ -49,7 +73,7 @@ function publishToBugsplat() { ./dump_syms /github/workspace/pktvisord > pktvisor.sym PKTVISOR_VERSION=$(cat VERSION) ls -lha - ./symupload -k $INPUT_BUGSPLAT_KEY pktvisor.sym $INPUT_BUGSPLAT_SYMBOL_URL$PKTVISOR_VERSION 2>/dev/null + ./symupload -k $INPUT_BUGSPLAT_KEY pktvisor.sym $INPUT_BUGSPLAT_SYMBOL_URL$INPUT_ARCH$PKTVISOR_VERSION 2>/dev/null fi } diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index c4c66e3fa..67258aed7 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -16,6 +16,7 @@ env: CTEST_OUTPUT_ON_FAILURE: 1 CONAN_NON_INTERACTIVE: 1 CONAN_REVISIONS_ENABLED: 1 + IMAGE_NAME: netboxlabs/pktvisor jobs: unit-tests-mac: @@ -61,7 +62,7 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build shell: bash - run: ctest -C $BUILD_TYPE + run: ctest -C $BUILD_TYPE --output-on-failure unit-tests-linux: runs-on: ubuntu-latest @@ -82,8 +83,8 @@ jobs: uses: actions/cache@v4 with: path: ${{github.workspace}}/build/p/ - key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} - restore-keys: conan-${{ runner.os }}- + key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} + restore-keys: conan-${{ runner.os }}-amd64- - name: Configure CMake shell: bash @@ -104,7 +105,7 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build shell: bash - run: sudo ctest -C $BUILD_TYPE + run: sudo ctest --output-on-failure build-win64: runs-on: windows-2019 @@ -231,10 +232,10 @@ jobs: uses: actions/cache@v4 with: path: ${{github.workspace}}/build/p/ - key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} - restore-keys: conan-${{ runner.os }}- + key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} + restore-keys: conan-${{ runner.os }}-amd64- - - name: Build pktvisord + push symbol to bugsplat.com + - name: Build pktvisord + push symbol to backtrace.io uses: ./.github/actions/build-cpp with: context: "." @@ -242,8 +243,9 @@ jobs: asan: "OFF" bugsplat_key: ${{secrets.BUGSPLAT_KEY}} bugsplat_symbol_url: ${{secrets.BUGSPLAT_SYMBOL_URL}} - bugsplat: "true" + bugsplat: "false" file: "./Dockerfile" + arch: "amd64" - name: Build pktvisor-cli uses: ./.github/actions/build-go @@ -255,15 +257,14 @@ jobs: run: ls -lha . - name: Get VERSION - id: build run: | echo "VERSION=${{needs.unit-tests-linux.outputs.version_number}}" >> $GITHUB_ENV - - name: Generate ref tag (develop) - run: echo "REF_TAG=latest-develop" >> $GITHUB_ENV - - - name: Debug ref tag - run: echo ${{ env.REF_TAG }} + - name: Docker meta + id: meta + uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 #v5.6.1 + with: + images: ${{ env.IMAGE_NAME }} - name: Login to Docker Hub uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3.3.0 @@ -289,24 +290,33 @@ jobs: uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 #v3.8.0 - name: Build + push - pktvisor (multi-arch) - env: - IMAGE_NAME: netboxlabs/pktvisor uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 #v6.10.0 + id: docker_build with: builder: ${{ steps.buildx.outputs.name }} context: . file: ./docker/Dockerfile.crashhandler platforms: linux/amd64 - push: true - tags: | - ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }} - ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }} - outputs: type=docker,dest=/tmp/amd64.tar + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,"name=${{ env.IMAGE_NAME }}",push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.docker_build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-linux-amd64 + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 build-app-image-x64: - needs: [ package-amd64 ] + needs: [ merge-packages ] runs-on: ubuntu-latest - #if: github.event_name != 'pull_request' steps: - uses: actions/checkout@v4 @@ -317,6 +327,13 @@ jobs: id: conan uses: turtlebrowser/get-conan@c171f295f3f507360ee018736a6608731aa2109d #v1.2 + - name: Setup Conan Cache + uses: actions/cache@v4 + with: + path: ${{github.workspace}}/build/p/ + key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} + restore-keys: conan-${{ runner.os }}-amd64- + - name: Configure CMake to generate VERSION shell: bash working-directory: ${{github.workspace}}/build @@ -365,15 +382,13 @@ jobs: - name: Build + push - pktvisor-prom-write env: - IMAGE_NAME: netboxlabs/pktvisor-prom-write + PROM_IMAGE_NAME: netboxlabs/pktvisor-prom-write working-directory: ${{github.workspace}}/centralized_collection/prometheus/docker-grafana-agent run: | - docker build . --file Dockerfile --build-arg PKTVISOR_TAG=${{ env.REF_TAG }} --tag ${{ env.IMAGE_NAME }}:${{ env.VERSION }} --tag ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }} - docker push -a ${{ env.IMAGE_NAME }} + docker build . --file Dockerfile --build-arg PKTVISOR_TAG=${{ env.REF_TAG }} --tag ${{ env.PROM_IMAGE_NAME }}:${{ env.VERSION }} --tag ${{ env.PROM_IMAGE_NAME }}:${{ env.REF_TAG }} + docker push -a ${{ env.PROM_IMAGE_NAME }} - name: Generate AppImage - env: - IMAGE_NAME: netboxlabs/pktvisor working-directory: ${{github.workspace}}/appimage run: | DEV_IMAGE="${{ env.IMAGE_NAME }}:${{ env.VERSION }}" DEV_MODE=t make pktvisor-x86_64.AppImage @@ -406,8 +421,8 @@ jobs: path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}-arm64- - - - name: Build pktvisord + push symbol to bugsplat.com + + - name: Build pktvisord + push symbol to backtrace.io uses: ./.github/actions/build-cpp with: context: "." @@ -417,6 +432,7 @@ jobs: bugsplat_symbol_url: ${{secrets.BUGSPLAT_SYMBOL_URL}} bugsplat: "false" file: "./Dockerfile" + arch: "arm64" - name: Build pktvisor-cli uses: ./.github/actions/build-go @@ -428,11 +444,11 @@ jobs: - name: Debug artifacts run: ls -lha . - - name: Generate ref tag (develop) - run: echo "REF_TAG=latest-develop" >> $GITHUB_ENV - - - name: Debug ref tag - run: echo ${{ env.REF_TAG }} + - name: Docker meta + id: meta + uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 #v5.6.1 + with: + images: ${{ env.IMAGE_NAME }} - name: Login to Docker Hub uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3.3.0 @@ -459,16 +475,65 @@ jobs: - name: Build + push - pktvisor (multi-arch) id: docker_build - env: - IMAGE_NAME: netboxlabs/pktvisor uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 #v6.10.0 with: builder: ${{ steps.buildx.outputs.name }} context: . file: ./docker/Dockerfile.crashhandler platforms: linux/arm64 - push: true + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,"name=${{ env.IMAGE_NAME }}",push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.docker_build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-linux-arm64 + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge-packages: + runs-on: ubuntu-latest + needs: [unit-tests-linux, package-amd64, package-arm64] + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Login to Docker Hub + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3.3.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 #v3.8.0 + + - name: Docker meta + id: meta + uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 #v5.6.1 + with: + images: ${{ env.IMAGE_NAME }} tags: | - ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }} - ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }} - outputs: type=docker,dest=/tmp/arm64.tar + type=raw,value=latest-develop + type=raw,value=${{ needs.unit-tests-linux.outputs.version_number }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} \ No newline at end of file diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index cc07e4673..b6aefab12 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -52,7 +52,7 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build shell: bash - run: sudo ctest -C $BUILD_TYPE + run: sudo ctest --output-on-failure prebuild-package: needs: [ unit-tests ] diff --git a/.github/workflows/build_cross.yml b/.github/workflows/build_cross.yml index 0232ab90d..593c29803 100644 --- a/.github/workflows/build_cross.yml +++ b/.github/workflows/build_cross.yml @@ -114,6 +114,13 @@ jobs: LDFLAGS=${{matrix.ldflags}} EOF + - name: Setup Conan Cache + uses: actions/cache@v4 + with: + path: ${{github.workspace}}/src/build/p/ + key: conan-${{ runner.os }}-${{matrix.arch}}-${{ hashFiles('**/conanfile.py') }} + restore-keys: conan-${{ runner.os }}-${{matrix.arch}}- + - name: Install dependencies working-directory: ${{github.workspace}}/src run: | diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index 4c10ec889..8aa1ea851 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -53,7 +53,7 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build shell: bash - run: sudo ctest + run: sudo ctest --output-on-failure - name: Build Coverage working-directory: ${{github.workspace}}/build @@ -82,17 +82,39 @@ jobs: key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- - - name: Build pktvisord + push symbol to backtrace.io - uses: ./.github/actions/build-cpp - with: - context: "." - build_type: "Debug" - asan: "ON" - symbol_url: ${{secrets.SYMBOL_URL}} - bugsplat_key: ${{secrets.BUGSPLAT_KEY}} - bugsplat_symbol_url: ${{secrets.BUGSPLAT_SYMBOL_URL}} - bugsplat: "true" - file: "./Dockerfile" + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCODE_COVERAGE=ON + + - name: Get VERSION + id: build + run: echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --build . --config Debug -- -j 4 + + - name: move files + shell: bash + run: | + cp -rf ${{github.workspace}}/build/bin/pktvisord ${{github.workspace}}/pktvisord + strip -s ${{github.workspace}}/build/bin/crashpad_handler + cp -rf ${{github.workspace}}/build/bin/crashpad_handler ${{github.workspace}}/crashpad_handler + cp -rf ${{github.workspace}}/build/bin/pktvisor-reader ${{github.workspace}}/pktvisor-reader + cp -rf ${{github.workspace}}/golang/pkg/client/version.go ${{github.workspace}}/version.go + cp -rf ${{github.workspace}}/src/tests/fixtures/pktvisor-port-service-names.csv ${{github.workspace}}/custom-iana.csv + + - name: Push symbols to bugsplat + shell: bash + run: | + wget https://github.com/orb-community/CrashpadTools/raw/main/linux/dump_syms + chmod a+x ./dump_syms + wget https://github.com/orb-community/CrashpadTools/raw/main/linux/symupload + chmod a+x ./symupload + ./dump_syms ${{github.workspace}}/pktvisord > pktvisor.sym + ./symupload -k ${{secrets.BUGSPLAT_KEY}} pktvisor.sym ${{secrets.BUGSPLAT_SYMBOL_URL}}${{env.VERSION}} 2>/dev/null - name: Build pktvisor-cli uses: ./.github/actions/build-go diff --git a/CMakeLists.txt b/CMakeLists.txt index f691f797a..6a74028c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.24) ####################################################### # VERSION diff --git a/README.md b/README.md index 3314aa254..991f39aad 100644 --- a/README.md +++ b/README.md @@ -591,8 +591,8 @@ pktvisor is developed and tested on Linux and OSX. A Windows port is in progress #### Dependencies -* [Conan](https://conan.io/) 1.X C++ package manager -* CMake >= 3.13 (`cmake`) +* [Conan](https://conan.io/) 2.X C++ package manager +* CMake >= 3.24 (`cmake`) * C++ compiler supporting C++17 For the list of packages included by conan, see [conanfile.py](conanfile.py) @@ -604,9 +604,9 @@ The general build steps are: ``` # clone the repository git clone https://github.com/netboxlabs/pktvisor.git -cd pktvisor -mkdir build && cd build - +cd pktvisor/ +conan profile detect -f +cd build/ # configure and handle dependencies cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake .. diff --git a/appimage/Dockerfile.part b/appimage/Dockerfile.part index 9a45c6831..01ebfc0c7 100644 --- a/appimage/Dockerfile.part +++ b/appimage/Dockerfile.part @@ -1,7 +1,7 @@ # file is needed for appimagetool when its run with --appimage-extract-and-run # binutil is needed for strip RUN apt-get update && apt-get install -yqq --no-install-recommends python3-pip binutils file dietlibc-dev gcc musl musl-tools \ - && pip3 install --user exodus-bundler --no-warn-script-location \ + && pip3 install --user exodus-bundler --no-warn-script-location --break-system-packages \ && /root/.local/bin/exodus --verbose --tarball --output=/tmp/pktvisor.tgz $(which pktvisord) $(which pktvisor-reader) \ && mkdir pktvisor \ && tar --strip=1 -xf /tmp/pktvisor.tgz -C pktvisor/ \ diff --git a/centralized_collection/prometheus/docker-grafana-agent/Dockerfile b/centralized_collection/prometheus/docker-grafana-agent/Dockerfile index 778bde658..a3f5627ab 100644 --- a/centralized_collection/prometheus/docker-grafana-agent/Dockerfile +++ b/centralized_collection/prometheus/docker-grafana-agent/Dockerfile @@ -1,13 +1,13 @@ ARG PKTVISOR_TAG=latest -FROM grafana/agent:latest as agent +FROM grafana/agent:latest AS agent FROM netboxlabs/pktvisor:${PKTVISOR_TAG} COPY --from=agent /bin/grafana-agent /usr/local/bin/agent RUN apt-get update \ - && apt-get install -y runit-init \ - && rm -rf /var/lib/apt \ + && apt-get install -y runit \ + && rm -rf /var/lib/apt/lists/* \ && mkdir -p /etc/runit/ \ && mkdir -p /etc/agent/ \ && mkdir -p /etc/agent/data \ diff --git a/docker/Dockerfile b/docker/Dockerfile index 597fd85e0..a21c6345c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,12 @@ -FROM debian:bullseye-slim AS cppbuild +FROM ubuntu:noble AS cppbuild -ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools python ca-certificates" +ENV BUILD_DEPS "g++ cmake make automake autoconf git pkgconf jq python3 python3-pip python3-setuptools ca-certificates" RUN \ apt-get update && \ - apt-get upgrade --yes --force-yes && \ - apt-get install --yes --force-yes --no-install-recommends ${BUILD_DEPS} && \ - pip3 install conan + apt-get upgrade --yes && \ + apt-get install --yes --no-install-recommends ${BUILD_DEPS} && \ + pip3 install conan --break-system-packages # need git for current hash for VERSION COPY ./.git/ /pktvisor-src/.git/ @@ -20,16 +20,14 @@ COPY ./integration_tests/ /pktvisor-src/integration_tests/ COPY ./cmake/ /pktvisor-src/cmake/ COPY ./CMakeLists.txt /pktvisor-src/ COPY ./conanfile.py /pktvisor-src/ +COPY ./.conanrc /pktvisor-src/ -WORKDIR /tmp/build +WORKDIR /pktvisor-src RUN \ - conan profile new --detect default && \ - conan profile update settings.compiler.libcxx=libstdc++11 default && \ - conan config set general.revisions_enabled=1 - -RUN \ - PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake /pktvisor-src && \ + conan profile detect -f && \ + cd build/ && \ + PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake .. && \ make all -j 4 FROM golang:latest AS gobuild @@ -38,14 +36,14 @@ WORKDIR /src/ COPY --from=cppbuild /pktvisor-src/golang/pkg/client/version.go /src/pkg/client/version.go RUN go build -o pktvisor-cli cmd/pktvisor-cli/main.go -FROM debian:bullseye-slim AS runtime +FROM ubuntu:noble AS runtime ENV RUNTIME_DEPS "curl ca-certificates wget" RUN \ apt-get update && \ - apt-get upgrade --yes --force-yes && \ - apt-get install --yes --force-yes --no-install-recommends ${RUNTIME_DEPS} && \ + apt-get upgrade --yes && \ + apt-get install --yes --no-install-recommends ${RUNTIME_DEPS} && \ rm -rf /var/lib/apt #create dir and download geo db @@ -56,9 +54,9 @@ RUN cd /geo-db && wget https://github.com/orb-community/geo-asn-database/raw/mai RUN mkdir /iana COPY --from=cppbuild /pktvisor-src/src/tests/fixtures/pktvisor-port-service-names.csv /iana/custom-iana.csv -COPY --from=cppbuild /tmp/build/bin/pktvisord /usr/local/sbin/pktvisord -COPY --from=cppbuild /tmp/build/bin/crashpad_handler /usr/local/sbin/crashpad_handler -COPY --from=cppbuild /tmp/build/bin/pktvisor-reader /usr/local/sbin/pktvisor-reader +COPY --from=cppbuild /pktvisor-src/build/bin/pktvisord /usr/local/sbin/pktvisord +COPY --from=cppbuild /pktvisor-src/build/bin/crashpad_handler /usr/local/sbin/crashpad_handler +COPY --from=cppbuild /pktvisor-src/build/bin/pktvisor-reader /usr/local/sbin/pktvisor-reader COPY --from=gobuild /src/pktvisor-cli /usr/local/bin/pktvisor-cli COPY ./docker/entry-cp.sh /entry-cp.sh COPY ./docker/run.sh /run.sh diff --git a/docker/Dockerfile.crashhandler b/docker/Dockerfile.crashhandler index 4295f2088..d5bd81523 100644 --- a/docker/Dockerfile.crashhandler +++ b/docker/Dockerfile.crashhandler @@ -1,11 +1,11 @@ -FROM debian:bullseye-slim +FROM ubuntu:noble ENV RUNTIME_DEPS "curl ca-certificates libasan6 wget gzip" RUN \ apt-get update && \ - apt-get upgrade --yes --force-yes && \ - apt-get install --yes --force-yes --no-install-recommends ${RUNTIME_DEPS} && \ + apt-get upgrade --yes && \ + apt-get install --yes --no-install-recommends ${RUNTIME_DEPS} && \ rm -rf /var/lib/apt # copy files