squid

babim/squid Docker Image

自动构建

基于Alpine Linux的Squid 4代理镜像,支持认证配置与公开访问,适用于网络代理缓存及内部网络代理场景。

4 次收藏下载次数: 0状态:自动构建维护者:babim仓库类型:镜像最近更新:
下载命令
点击查看

Quickstart

(thanks Sameer Naik - sameersbn)

Start Squid using:

bash
docker 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.

bash
export 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.

dockerfile
ENV 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:

bash
docker 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.

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 squid 镜像标签

docker pull docker.xuanyuan.run/babim/squid:<标签>

DockerHub 原生拉取命令

docker pull babim/squid:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告