babim/squid Docker Image
基于Alpine Linux的Squid 4代理镜像,支持认证配置与公开访问,适用于网络代理缓存及内部网络代理场景。
Quickstart
(thanks Sameer Naik - sameersbn)
Start Squid using:
bashdocker run --name squid -d --restart=always \ --publish 3128:3128 \ --volume /srv/docker/squid/:/squid \ babim/squid
Volume dir:
/squid/cache /squid/log /squid/config
authentication
The user must specify authentication credentials via the following environment variables:
-e AUTH=true USERNAME=foo (default) PASSWORD=bar (default)
Public access
You can access from internet via the following environment variables:
-e PUBLIC=true
Usage
Configure your web browser network/connection settings to use the proxy server which is available at 172.17.42.1:3128
If you are using Linux then you can also add the following lines to your .bashrc file allowing command line applications to use the proxy server for outgoing connections.
bashexport ftp_proxy=http://172.17.42.1:3128 export http_proxy=http://172.17.42.1:3128 export https_proxy=http://172.17.42.1:3128
To use Squid in you Docker containers add the following line to your Dockerfile.
dockerfileENV http_proxy=http://172.17.42.1:3128 \ https_proxy=http://172.17.42.1:3128 \ ftp_proxy=http://172.17.42.1:3128
Logs
To access the Squid logs, located at /var/log/squid/, you can use docker exec. For example, if you want to tail the access logs:
bashdocker exec -it squid tail -f /var/log/squid/access.log
You can also mount a volume at /var/log/squid/ so that the logs are directly accessible on the host.
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务