Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

opensciencegrid/docker-frontier-squid

 
 

Repository files navigation

Frontier Squid Container Image Build Status

A Docker container image for Squid proxy server as packaged by OSG. The image is built according to the OSG installation instructions.

Usage

To run with the defaults:

docker run --rm --name frontier-squid \
  -p 3128:3128 opensciencegrid/frontier-squid:stable

See our documentation for details of our docker image tags.

Configuring Squid

The recommended way to configure the squid in the container is by means of environment variables. Three such variables are supported:

Variable name Description Defaults
SQUID_IPRANGE Limits the incoming connections to the provided whitelist. By default only standard private network addresses are whitelisted.
SQUID_CACHE_DISK Sets the cache_dir option which determines the disk size squid uses. Must be an integer value, and its unit is MBs. Note: The cache disk area is located at /var/cache/squid. Defaults to 10000.
SQUID_CACHE_MEM Sets the cache_mem option which regulates the size squid reserves for caching small objects in memory. Defaults to "128 MB".

Additional configuration changes may be made by files in /etc/squid/customize.d. See the documentation for that in squid-customize.sh.

Moreover, be aware that in order to preserve the cache between redeployments, you should map the following areas to persistent storage outside the container:

Mountpoint Description Example docker mount
/var/cache/squid This directory contains the cache for squid. See also SQUID_CACHE_DISK above. -v /tmp/squid:/var/cache/squid
/var/log/squid This directory contains the squid logs. -v /tmp/log:/var/log/squid

For more details, see the Frontier Squid documentation.

Validate

To validate your installation:

> export http_proxy=http://localhost:3128
> wget -qdO/dev/null http://frontier.cern.ch 2>&1 | grep X-Cache
X-Cache: MISS from 797a56e426cf
> wget -qdO/dev/null http://frontier.cern.ch 2>&1 | grep X-Cache
X-Cache: HIT from 797a56e426cf

Languages

  • Shell 54.3%
  • Dockerfile 41.1%
  • Awk 4.6%