Docker Mini Server / AWS Elastic Beanstalk

Docker Mini Server / AWS Elastic Beanstalk

Saturday, Sep 5, 2020 by Leon

I haven’t gotten into Docker much yet, even thought it’s had quite the buzz over the past few years. As both part of a proposal for a prospective client, along with doint a proof of concept, I put together a docker image based on Alpine Linux, utilizing ClamAV/Freshclam and Darkhttpd to provide a local mirror of ClamAV virus definitions.

There was a bit of a learning curve to get all the moving pieces to work togther, but I think it turned out pretty well. Basically, I set up a base Alpine Linux docker image, added freshclam, darkhttpd, openrc, and lua5.3. Darkhttpd was configured to serve up the /var/lib/clamav directory that held the ClamAV virus definitions, and I wrote a script in lua that freshclam calls to update an index.html page in the database directory that lists the data files, their sizes, and date/time that they were updated.

Previously I had downloaded a Docker book for my kindle which came in very handy for this excersize. I would higly recommend this for anyone learning docker.

The initial coding was half the battle, the harder part was getting it deployed to Amazon Elastic Beanstalk, sizing the instance properly, and then figuring out how to debug and update it. In the end it wasn’t as bad as I had thought it was going to be. If you do go down this road I suggest that you be sure to install the elastic beanstalk command line utility, which really helps connecting to a running instance.

If anyone is interested let me know and I’ll put everyting up in a public git repository for your perusal. The end result can be found here for now.