Skip to content

Commit

Permalink
v4.2.0 (#130)
Browse files Browse the repository at this point in the history
Major updates
* Adding new test framework

Minor updates
* Using latest base images
* Using new BF_PUBLISHING environment variable
  • Loading branch information
bfren authored Feb 23, 2024
1 parent 596228e commit bc4740d
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 22 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ on:
tags-ignore: ['**']
workflow_dispatch:

env:
TEST_TAG: clamav:test

jobs:
test:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
build:
strategy:
fail-fast: false
Expand Down Expand Up @@ -45,6 +42,29 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and export
id: docker_export
uses: docker/build-push-action@v5
with:
file: ./${{ matrix.clamav }}/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
load: true
tags: ${{ env.TEST_TAG }}
-
name: Run tests
id: docker_test
run: |
docker run --entrypoint "/usr/bin/env" ${{ env.TEST_TAG }} -i nu -c "use bf test ; test"
-
name: Build and push
id: docker_build
Expand All @@ -55,12 +75,13 @@ jobs:
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_VERSION=${{ steps.version.outputs.contents }}
BF_PUBLISH=0
push: ${{ startsWith(github.ref, 'refs/heads/') }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
bfren/clamav:clamav${{ matrix.clamav }}-dev
bfren/clamav:clamav${{ matrix.clamav }}-${{ steps.version.outputs.contents }}-dev
ghcr.io/bfren/clamav:clamav${{ matrix.clamav }}-dev
ghcr.io/bfren/clamav:clamav${{ matrix.clamav }}-${{ steps.version.outputs.contents }}-dev
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
18 changes: 17 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
Expand All @@ -75,6 +82,11 @@ jobs:
bfren/clamav:clamav${{ matrix.clamav }}-${{ steps.version_minor.outputs.contents }}
bfren/clamav:clamav${{ matrix.clamav }}-${{ steps.version.outputs.contents }}
bfren/clamav:clamav${{ steps.clamav_revision.outputs.contents }}
ghcr.io/bfren/clamav:clamav${{ matrix.clamav }}
ghcr.io/bfren/clamav:clamav${{ matrix.clamav }}-${{ steps.version_major.outputs.contents }}
ghcr.io/bfren/clamav:clamav${{ matrix.clamav }}-${{ steps.version_minor.outputs.contents }}
ghcr.io/bfren/clamav:clamav${{ matrix.clamav }}-${{ steps.version.outputs.contents }}
ghcr.io/bfren/clamav:clamav${{ steps.clamav_revision.outputs.contents }}
-
name: Build and push default tags
id: docker_build_default
Expand All @@ -85,15 +97,19 @@ jobs:
file: ./${{ matrix.clamav }}/Dockerfile
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
BF_PUBLISHING=1
BF_VERSION=${{ steps.version.outputs.contents }}
BF_PUBLISH=1
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
bfren/clamav:latest
bfren/clamav:${{ steps.version_major.outputs.contents }}
bfren/clamav:${{ steps.version_minor.outputs.contents }}
bfren/clamav:${{ steps.version.outputs.contents }}
ghcr.io/bfren/clamav:latest
ghcr.io/bfren/clamav:${{ steps.version_major.outputs.contents }}
ghcr.io/bfren/clamav:${{ steps.version_minor.outputs.contents }}
ghcr.io/bfren/clamav:${{ steps.version.outputs.contents }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
4 changes: 2 additions & 2 deletions 0.104/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM bfren/alpine-s6:alpine3.16-5.1.4
FROM bfren/alpine-s6:alpine3.16-5.2.2

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-clamav"

ARG BF_IMAGE
ARG BF_PUBLISHING
ARG BF_VERSION
ARG BF_PUBLISH

COPY ./overlay /
COPY ./0.104/overlay /
Expand Down
4 changes: 2 additions & 2 deletions 0.105/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM bfren/alpine-s6:alpine3.17-5.1.4
FROM bfren/alpine-s6:alpine3.17-5.2.2

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-clamav"

ARG BF_IMAGE
ARG BF_PUBLISHING
ARG BF_VERSION
ARG BF_PUBLISH

COPY ./overlay /
COPY ./0.105/overlay /
Expand Down
4 changes: 2 additions & 2 deletions 1.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM bfren/alpine-s6:alpine3.18-5.1.4
FROM bfren/alpine-s6:alpine3.18-5.2.2

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-clamav"

ARG BF_IMAGE
ARG BF_PUBLISHING
ARG BF_VERSION
ARG BF_PUBLISH

COPY ./overlay /
COPY ./1.1/overlay /
Expand Down
4 changes: 2 additions & 2 deletions 1.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM bfren/alpine-s6:alpine3.19-5.1.4
FROM bfren/alpine-s6:alpine3.19-5.2.2

LABEL org.opencontainers.image.source="https://github.com/bfren/docker-clamav"

ARG BF_IMAGE
ARG BF_PUBLISHING
ARG BF_VERSION
ARG BF_PUBLISH

COPY ./overlay /
COPY ./1.2/overlay /
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.esh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM bfren/alpine-s6:alpine<%= ${ALPINE_EDITION} %>-<%= ${BASE_VERSION} %>
LABEL org.opencontainers.image.source="https://github.com/bfren/docker-clamav"

ARG BF_IMAGE
ARG BF_PUBLISHING
ARG BF_VERSION
ARG BF_PUBLISH

COPY ./overlay /
COPY ./<%= ${CLAMAV_VERSION} %>/overlay /
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.4
4.2.0
2 changes: 1 addition & 1 deletion VERSION_MINOR
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1
4.2
2 changes: 1 addition & 1 deletion generate-dockerfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

docker pull bfren/alpine

BASE_VERSION="5.1.4"
BASE_VERSION="5.2.2"
echo "Base: ${BASE_VERSION}"

CLAMAV_VERSIONS="0.104 0.105 1.1 1.2"
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion overlay/tmp/install
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main [] {
bf build add ClamAV $version

# download the main database so startup is much quicker (makes for larger image size)
if (bf env check PUBLISH) { ^freshclam }
if (bf env check PUBLISHING) { ^freshclam }

# add bf-clamav module to config
bf config use bf-clamav
Expand Down
2 changes: 1 addition & 1 deletion pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ if [ -n "${1-}" ] ; then
git checkout ${1} && git pull
fi

chmod +x pull.sh run.sh
chmod +x pull.sh run.sh test.sh
16 changes: 16 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

IMAGE=clamav
VERSION=`cat VERSION`
CLAMAV=${1:-1.2}
TAG=${IMAGE}-test

docker buildx build \
--load \
--build-arg BF_IMAGE=${IMAGE} \
--build-arg BF_VERSION=${VERSION} \
-f ${CLAMAV}/Dockerfile \
-t ${TAG} \
. \
&& \
docker run --entrypoint "/usr/bin/env" ${TAG} -i nu -c "use bf test ; test"

0 comments on commit bc4740d

Please sign in to comment.