diff --git a/.docker/prod-oldstable.Dockerfile b/.docker/prod-oldstable.Dockerfile new file mode 100644 index 00000000..a1ad6986 --- /dev/null +++ b/.docker/prod-oldstable.Dockerfile @@ -0,0 +1,24 @@ +ARG VERSION=latest + +FROM debian:oldstable-slim AS build +COPY . /source +RUN sh /source/.github/install-openvas-smb-dependencies.sh + +RUN cmake -DCMAKE_BUILD_TYPE=Release -B/build /source +RUN DESTDIR=/install cmake --build /build -- install + +FROM debian:oldstable-slim + +RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \ + libgnutls30 \ + libgssapi3-heimdal \ + libkrb5-26-heimdal \ + libasn1-8-heimdal \ + libroken18-heimdal \ + libhdb9-heimdal \ + libpopt0 \ + && 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 f61d398d..c9d3e32f 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -82,3 +82,32 @@ 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 }} )' + id: meta-oldstable + uses: docker/metadata-action@v4 + with: + images: ${{ github.repository }} + labels: | + org.opencontainers.image.vendor=Greenbone + org.opencontainers.image.base.name=debian:oldstable-slim + flavor: latest=false # no auto latest container tag for git tags + tags: | + # for the images provided for debian:oldstable we just provide + # oldstable on an new version or oldstable-edge when it is on main. + # oldstable-branch-sha on a branch + type=raw,value=oldstable,enable=${{ env.IS_LATEST_TAG }} + # if we are on the main branch set edge + type=raw,value=oldstable-edge,enable=${{ github.ref_name == 'main' }} + # use branch-sha otherwise for pushes to branches other then main (will not be uploaded) + type=raw,value=oldstable-{{branch}}-{{sha}},enable=${{ github.ref_type == 'branch' && github.event_name == 'push' && github.ref_name != 'main' }} + # use pr-$PR_ID for pull requests (will not be uploaded) + type=ref,event=pr + - name: Build and push Container image oldstable + 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-oldstable.Dockerfile + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta-oldstable.outputs.tags }} + labels: ${{ steps.meta-oldstable.outputs.labels }}