diff --git a/.docker/prod-testing.Dockerfile b/.docker/prod-testing.Dockerfile new file mode 100644 index 00000000..d79b5c8a --- /dev/null +++ b/.docker/prod-testing.Dockerfile @@ -0,0 +1,35 @@ +ARG VERSION=unstable +# this allows to work on forked repository +ARG REPOSITORY=greenbone/gvm-libs +FROM debian:testing-slim AS build +ARG DEBIAN_FRONTEND=noninteractive + +# Install +COPY . /source +RUN sh /source/.github/install-dependencies.sh +RUN cmake -DCMAKE_BUILD_TYPE=Release -B/build /source +RUN DESTDIR=/install cmake --build /build -- install + +FROM debian:testing-slim + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + libglib2.0-0 \ + libgpgme11 \ + libgnutls30 \ + libuuid1 \ + libssh-gcrypt-4 \ + libhiredis0.14 \ + libxml2 \ + libpcap0.8 \ + libnet1 \ + libldap-common \ + libradcli4 \ + libpaho-mqtt1.3 \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=build /install/ / + +RUN ldconfig diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index f29b8d4d..11e52b95 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -40,7 +40,7 @@ jobs: # set this tag to latest and stable echo "IS_LATEST_TAG=true" >> $GITHUB_ENV fi - - name: "Setup meta information (IS_VERSION_TAG: ${{ env.IS_VERSION_TAG }}, IS_LATEST_TAG: ${{ env.IS_LATEST_TAG }} )" + - name: "Setup meta information debian:stable" id: meta uses: docker/metadata-action@v4 with: @@ -82,7 +82,8 @@ jobs: platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - name: "Setup meta information (IS_VERSION_TAG: ${{ env.IS_VERSION_TAG }}, IS_LATEST_TAG: ${{ env.IS_LATEST_TAG }} )" + + - name: "Setup meta information debian:oldstable" id: old_stable_meta uses: docker/metadata-action@v4 with: @@ -109,6 +110,33 @@ jobs: tags: ${{ steps.old_stable_meta.outputs.tags }} labels: ${{ steps.old_stable_meta.outputs.labels }} + - name: "Setup meta information debian:testing" + id: testing_meta + uses: docker/metadata-action@v4 + with: + images: ${{ github.repository }} + labels: | + org.opencontainers.image.vendor=Greenbone + org.opencontainers.image.base.name=debian:testing-slim + flavor: latest=false # no auto latest container tag for git tags + tags: | + # for the images provided for debian:testing we just provide + # testing on an new version or testing-edge when it is on main. + # testing-branch-sha on a branch + type=raw,value=testing,enable=${{ env.IS_LATEST_TAG }} + type=raw,value=testing-edge,enable=${{ github.ref_name == 'main' }} + type=raw,value=testing-{{branch}}-{{sha}},enable=${{ github.ref_type == 'branch' && github.event_name == 'push' && github.ref_name != 'main' }} + type=ref,event=pr + - name: Build and push Container image + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' && (github.ref_type == 'tag' || github.ref_name == 'main') }} + file: .docker/prod-testing.Dockerfile + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.testing_meta.outputs.tags }} + labels: ${{ steps.testing_meta.outputs.labels }} + # triggers projects that work with stable branches on a new stable tag trigger-stable-projects: needs: production