Comment 0 for bug 1977586

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

https://hub.docker.com/r/ubuntu/squid is documenting some options to the container image, namely:

-e TZ=UTC Timezone.
-p 3128:3128 Expose the proxy service
-v /path/to/logs:/var/log/squid Volume to store squid logs
-v /path/to/data:/var/spool/squid Volume to store the squid cache

I think it's missing a line in that table for the main squid configuration file, and config snippets. For example:

-v /path/to/main/config:/etc/squid/squid.conf Main squid configuration file
-v /path/to/config/snippet:/etc/squid/conf.d/snippet.conf Configuration snippets included by squid.conf

For example, the main squid.conf file supplied with the image has no cache_dir directive, which means all the caching is done in memory. In other words, /var/spool/squid stays empty. If you add a config snippet like the below one, then when the container starts, it will also use the disk for caching:

cache_dir diskd /var/spool/squid 10240 16 256

There are many storage types, diskd was just an example, and I agree the container can't make a choice like that. But I think it's important to document how to change the config, and snippets, because very likely someone will want to use storage for cache as well, and then we can give an example in the docs like above.