diff --git a/.docker/prod.Dockerfile b/.docker/prod.Dockerfile index 531cbe555..9de529b6c 100644 --- a/.docker/prod.Dockerfile +++ b/.docker/prod.Dockerfile @@ -2,8 +2,14 @@ ARG VERSION=edge ARG GVM_LIBS_VERSION=oldstable ARG DEBIAN_FRONTEND=noninteractive ARG IMAGE_REGISTRY=ghcr.io +# when set it will added to the cmake command +# As an example: +# FEATURE_TOGGLES="-DOPENVASD=1" +# enables openvasd feature toggle. +ARG FEATURE_TOGGLE="" FROM ${IMAGE_REGISTRY}/greenbone/gvmd-build:${VERSION} as builder +ARG FEATURE_TOGGLE COPY . /source WORKDIR /source @@ -11,7 +17,7 @@ WORKDIR /source RUN mkdir /build && \ mkdir /install && \ cd /build && \ - cmake -DCMAKE_BUILD_TYPE=Release /source && \ + cmake -DCMAKE_BUILD_TYPE=Release $FEATURE_TOGGLE /source && \ make DESTDIR=/install install FROM greenbone/gvm-libs:${GVM_LIBS_VERSION} diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index b927fd34d..fae71ee82 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -14,6 +14,7 @@ jobs: build: - stable - edge + - edge_openvasd name: "Build Images" runs-on: ubuntu-latest steps: @@ -32,6 +33,7 @@ jobs: type=raw,value=latest,enable=${{ matrix.build == 'stable' }} type=raw,value=stable,enable=${{ matrix.build == 'stable' }} type=raw,value=edge,enable=${{ matrix.build == 'edge' }} + type=raw,value=edge-openvasd,enable=${{ matrix.build == 'edge_openvasd' }} - name: Set container build options id: container-opts run: | @@ -40,6 +42,11 @@ jobs: else echo "gvm-libs-version=oldstable-edge" >> $GITHUB_OUTPUT fi + if [[ "${{ matrix.build }}" = 'edge_openvasd' ]]; then + echo 'ft=-DOPENVASD=1' >> $GITHUB_OUTPUT + else + echo 'ft=-DOPENVASD=0' >> $GITHUB_OUTPUT + fi - name: Login to GitHub Docker registry uses: docker/login-action@v3 with: @@ -58,6 +65,7 @@ jobs: push: true build-args: | GVM_LIBS_VERSION=${{ steps.container-opts.outputs.gvm-libs-version }} + FEATURE_TOGGLE=${{ steps.container-opts.outputs.ft }} file: .docker/build.Dockerfile platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }}