├── docker-entrypoint.sh └── Dockerfile /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | sigint() 6 | { 7 | echo "signal INT received, script ending" 8 | /etc/init.d/avgd stop 9 | exit 0 10 | } 11 | 12 | if [ "$1" = 'avg' ]; then 13 | trap 'sigint' INT 14 | /etc/init.d/avgd start 15 | /etc/init.d/avgd status 16 | PID=$(cat /opt/avg/av/var/run/avgd.pid) 17 | while test -d "/proc/$PID"; do 18 | sleep 60 19 | done 20 | fi 21 | 22 | exec "$@" -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM krallin/ubuntu-tini:xenial 2 | MAINTAINER ZEROSPAM, https://github.com/zerospam 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | # Make sure that Upstart won't try to start avgd after dpkg installs it 6 | # https://github.com/dotcloud/docker/issues/446 7 | #ADD policy-rc.d /usr/sbin/policy-rc.d 8 | #RUN /bin/chmod 755 /usr/sbin/policy-rc.d 9 | 10 | ADD http://fiodor.zerospam.ca/ubuntu/zerospam-base-config.gpg /tmp/fiodor.gpg 11 | 12 | # Install Requirements 13 | RUN apt-key add /tmp/fiodor.gpg && \ 14 | dpkg --add-architecture i386 && \ 15 | echo "deb http://fiodor.zerospam.ca/ubuntu xenial zs" > /etc/apt/sources.list.d/fiodor.list && \ 16 | apt-get update && \ 17 | apt-get install -y avg2013flx:i386 \ 18 | && rm -rf /var/lib/apt/lists/* /tmp/fiodor.gpg 19 | 20 | # Install AVG 21 | RUN avgcfgctl -w Default.setup.daemonize=false && \ 22 | avgcfgctl -w Default.tcpd.avg.address=0.0.0.0 23 | 24 | ADD docker-entrypoint.sh / 25 | 26 | VOLUME [ "/opt/avg/av/var/data" ] 27 | 28 | ENTRYPOINT ["/usr/local/bin/tini", "--", "/docker-entrypoint.sh"] --------------------------------------------------------------------------------