├── .gitignore ├── health.sh ├── docker-compose.yml ├── Dockerfile ├── entrypoint.sh ├── LICENSE ├── .github └── ISSUE_TEMPLATE │ ├── documentation.yaml │ ├── feature.yaml │ └── bug.yaml ├── .travis.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /health.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! "$(echo PING | nc localhost 3310)" = "PONG" ]; then 4 | echo "ping failed" 5 | exit 1 6 | fi 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3.7' 3 | 4 | services: 5 | freshclam: 6 | build: . 7 | environment: 8 | MODE: freshclam 9 | volumes: 10 | - conf:/etc/clamav 11 | - data:/var/lib/clamav 12 | 13 | clamav: 14 | depends_on: 15 | - freshclam 16 | build: . 17 | environment: 18 | MODE: clamd 19 | ulimits: 20 | stack: 1048576 21 | volumes: 22 | - conf:/etc/clamav 23 | - data:/var/lib/clamav 24 | ports: 25 | - "3310:3310" 26 | 27 | volumes: 28 | conf: 29 | data: 30 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.16 2 | 3 | LABEL maintainer="team@appwrite.io" 4 | 5 | RUN apk add --no-cache \ 6 | clamav=0.104.3-r0 \ 7 | su-exec=0.2-r1 \ 8 | rm -rf /var/cache/apk/* && \ 9 | install -d -o clamav -g clamav -m 700 /run/clamav; \ 10 | sed -i 's/^#\(Foreground\)/\1/' /etc/clamav/freshclam.conf; \ 11 | sed -i 's/^#\(Foreground \).*/\1yes/' /etc/clamav/clamd.conf; \ 12 | sed -i 's/^#\(TCPSocket \)/\1/' /etc/clamav/clamd.conf; \ 13 | sed -i 's/^#\(CompressLocalDatabase \).*/\1yes/' /etc/clamav/freshclam.conf; \ 14 | tar -cvjf /etc/_clamav.tar.bz2 etc/clamav 15 | 16 | COPY entrypoint.sh /start.sh 17 | COPY health.sh /health.sh 18 | 19 | RUN chmod +x /start.sh /health.sh 20 | 21 | ENTRYPOINT ["/start.sh"] 22 | 23 | VOLUME /etc/clamav 24 | VOLUME /var/lib/clamav 25 | 26 | HEALTHCHECK --start-period=350s CMD /health.sh 27 | 28 | EXPOSE 3310/tcp 29 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ ! "$(ls -A /etc/clamav)" ]; then 6 | tar -xvjf /etc/_clamav.tar.bz2 / 7 | 8 | sed -i 's/^#\(TCPSocket \)/\1/' /etc/clamav/clamd.conf 9 | sed -i 's/^#\(Foreground \).*/\1yes/' /etc/clamav/clamd.conf 10 | sed -i 's/^#\(Foreground \).*/\1yes/' /etc/clamav/freshclam.conf 11 | sed -i 's/^#\(CompressLocalDatabase \).*/\1yes/' /etc/clamav/freshclam.conf 12 | fi 13 | 14 | if [ ! -f /var/lib/clamav/main.cvd ]; then 15 | echo "Starting initial definition download" 16 | /usr/bin/freshclam 17 | fi 18 | 19 | if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then 20 | case $MODE in 21 | clamd) 22 | echo "Starting clamav daemon" 23 | set -- /usr/sbin/clamd $@ 24 | ;; 25 | freshclam) 26 | echo "Starting the update daemon" 27 | set -- /usr/bin/freshclam -d -p "/run/clamav/freshclam.pid" $@ 28 | ;; 29 | *) 30 | set -- /bin/sh 31 | ;; 32 | esac 33 | fi 34 | 35 | exec su-exec clamav "$@" 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Appwrite.io 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yaml: -------------------------------------------------------------------------------- 1 | name: "📚 Documentation" 2 | description: "Report an issue related to documentation" 3 | title: "📚 Documentation: " 4 | labels: [documentation] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking out time to make our documentation better 🙏 10 | - type: textarea 11 | id: issue-description 12 | validations: 13 | required: true 14 | attributes: 15 | label: "💭 Description" 16 | description: "A clear and concise description of what the issue is." 17 | placeholder: "Documentation should not ..." 18 | - type: checkboxes 19 | id: no-duplicate-issues 20 | attributes: 21 | label: "👀 Have you spent some time to check if this issue has been raised before?" 22 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 23 | options: 24 | - label: "I checked and didn't find similar issue" 25 | required: true 26 | - type: checkboxes 27 | id: read-code-of-conduct 28 | attributes: 29 | label: "🏢 Have you read the Code of Conduct?" 30 | options: 31 | - label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 32 | required: true -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | notifications: 3 | email: 4 | - team@appwrite.io 5 | 6 | language: minimal 7 | 8 | arch: 9 | - amd64 10 | - arm64 11 | 12 | os: linux 13 | dist: focal 14 | 15 | before_install: 16 | - curl -fsSL https://get.docker.com | sh 17 | - echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json 18 | - mkdir -p $HOME/.docker 19 | - echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json 20 | - sudo service docker start 21 | - > 22 | if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then 23 | echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin 24 | fi 25 | - docker --version 26 | 27 | install: 28 | - docker-compose up -d 29 | 30 | script: 31 | - sleep 10 32 | - docker ps -a 33 | - docker-compose logs clamav 34 | - > 35 | if : >/dev/tcp/localhost/3310; then 36 | echo 'Connection available.' 37 | travis_terminate 0 38 | else 39 | echo 'Connection unavailable.' 40 | travis_terminate 1 41 | fi 42 | 43 | deploy: 44 | - provider: script 45 | edge: true 46 | script: docker run --rm --privileged linuxkit/binfmt:v0.8 && 47 | docker buildx create --use && 48 | docker buildx build --platform linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x -t appwrite/clamav:$TRAVIS_TAG ./ --push 49 | on: 50 | tags: true 51 | condition: $TRAVIS_CPU_ARCH = amd64 52 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.yaml: -------------------------------------------------------------------------------- 1 | name: 🚀 Feature 2 | description: "Submit a proposal for a new feature" 3 | title: "🚀 Feature: " 4 | labels: [feature] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out our feature request form 🙏 10 | - type: textarea 11 | id: feature-description 12 | validations: 13 | required: true 14 | attributes: 15 | label: "🔖 Feature description" 16 | description: "A clear and concise description of what the feature is." 17 | placeholder: "You should add ..." 18 | - type: textarea 19 | id: pitch 20 | validations: 21 | required: true 22 | attributes: 23 | label: "🎤 Pitch" 24 | description: "Please explain why this feature should be implemented and how it would be beneficial. Add examples, if applicable." 25 | placeholder: "In my use-case, ..." 26 | - type: checkboxes 27 | id: no-duplicate-issues 28 | attributes: 29 | label: "👀 Have you spent some time to check if this feature has already been implemented?" 30 | description: "Have you Googled for a similar issue or checked our older issues for a similar feature request?" 31 | options: 32 | - label: "I checked and didn't find similar feature request" 33 | required: true 34 | - type: checkboxes 35 | id: read-code-of-conduct 36 | attributes: 37 | label: "🏢 Have you read the Code of Conduct?" 38 | options: 39 | - label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 40 | required: true -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker ClamAV 2 | 3 | [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/clamav?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/clamav) 5 | [![Build Status](https://img.shields.io/travis/com/appwrite/docker-clamav?style=flat-square)](https://travis-ci.com/appwrite/docker-clamav) 6 | [![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io) 7 | [![Follow Appwrite on StackShare](https://img.shields.io/badge/follow%20on-stackshare-blue?style=flat-square)](https://stackshare.io/appwrite) 8 | 9 | A ClamAV docker image with auto database updates by the [Appwrite team](https://github.com/appwrite). Use this image and a compatible client library to connect to the ClamAV using a TCP connection. 10 | 11 | ## Getting Started 12 | 13 | These instructions will cover usage information to help your run ClamAV docker image 14 | 15 | ### Prerequisities 16 | 17 | In order to run this image you'll need docker installed. 18 | 19 | * [Windows](https://docs.docker.com/windows/started) 20 | * [OS X](https://docs.docker.com/mac/started/) 21 | * [Linux](https://docs.docker.com/linux/started/) 22 | 23 | ### Usage 24 | 25 | ```shell 26 | docker run appwrite/clamav 27 | ``` 28 | 29 | #### Environment Variables 30 | 31 | This image has no environment variables. 32 | 33 | #### Volumes 34 | 35 | You can mount any volume you need to allow the image to scan its files. 36 | 37 | ### Build / Release 38 | 39 | ``` 40 | docker build --tag appwrite/clamav:0.0.0 . 41 | docker push appwrite/clamav:0.0.0 42 | ``` 43 | 44 | Multi-arch build (experimental using [buildx](https://github.com/docker/buildx)): 45 | 46 | ``` 47 | docker buildx create --use 48 | docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le --tag appwrite/clamav:0.0.0 --push . 49 | ``` 50 | 51 | ## Find Us 52 | 53 | * [GitHub](https://github.com/appwrite) 54 | * [Discord](https://appwrite.io/discord) 55 | * [Twitter](https://twitter.com/appwrite_io) 56 | 57 | ## Copyright and license 58 | 59 | The MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) 60 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yaml: -------------------------------------------------------------------------------- 1 | name: "🐛 Bug Report" 2 | description: "Submit a bug report to help us improve" 3 | title: "🐛 Bug Report: " 4 | labels: [bug] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out our bug report form 🙏 10 | - type: textarea 11 | id: steps-to-reproduce 12 | validations: 13 | required: true 14 | attributes: 15 | label: "👟 Reproduction steps" 16 | description: "How do you trigger this bug? Please walk us through it step by step." 17 | placeholder: "When I ..." 18 | - type: textarea 19 | id: expected-behavior 20 | validations: 21 | required: true 22 | attributes: 23 | label: "👍 Expected behavior" 24 | description: "What did you think should have happened?" 25 | placeholder: "It should ..." 26 | - type: textarea 27 | id: actual-behavior 28 | validations: 29 | required: true 30 | attributes: 31 | label: "👎 Actual Behavior" 32 | description: "What did actually happen? Add screenshots, if applicable." 33 | placeholder: "It actually ..." 34 | - type: dropdown 35 | id: appwrite-version 36 | attributes: 37 | label: "🎲 Appwrite version" 38 | description: "What version of Appwrite are you running?" 39 | options: 40 | - Version 0.10.x 41 | - Version 0.9.x 42 | - Version 0.8.x 43 | - Version 0.7.x 44 | - Version 0.6.x 45 | - Different version (specify in environment) 46 | validations: 47 | required: true 48 | - type: dropdown 49 | id: operating-system 50 | attributes: 51 | label: "💻 Operating system" 52 | description: "What OS is your server / device running on?" 53 | options: 54 | - Linux 55 | - MacOS 56 | - Windows 57 | - Something else 58 | validations: 59 | required: true 60 | - type: textarea 61 | id: enviromnemt 62 | validations: 63 | required: false 64 | attributes: 65 | label: "🧱 Your Environment" 66 | description: "Is your environment customized in any way?" 67 | placeholder: "I use Cloudflare for ..." 68 | - type: checkboxes 69 | id: no-duplicate-issues 70 | attributes: 71 | label: "👀 Have you spent some time to check if this issue has been raised before?" 72 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 73 | options: 74 | - label: "I checked and didn't find similar issue" 75 | required: true 76 | - type: checkboxes 77 | id: read-code-of-conduct 78 | attributes: 79 | label: "🏢 Have you read the Code of Conduct?" 80 | options: 81 | - label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 82 | required: true --------------------------------------------------------------------------------