Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.

http://www.cnblogs.com/mchina/p/3812190.html

https://hub.docker.com/r/sameersbn/squid/

https://github.com/sameersbn/docker-squid

docker pull sameersbn/squid:3.3.8-14

docker run --name squid -d --restart=always   --publish 3128:3128   --volume /srv/docker/squid/cache:/var/spool/squid3   sameersbn/squid:3.3.8-14

Configuration

Squid is a full featured caching proxy server and a large number of configuration parameters. To configure Squid as per your requirements edit the default squid.conf and volume mount it at/etc/squid3/squid.conf.

docker run --name squid -d --restart=always \
--publish 3128:3128 \
--volume /path/to/squid.conf:/etc/squid3/squid.conf \
--volume /srv/docker/squid/cache:/var/spool/squid3 \
sameersbn/squid:3.3.8-14

To reload the Squid configuration on a running instance you can send the HUP signal to the container.

docker kill -s HUP squid

Usage

Configure your web browser network/connection settings to use the proxy server which is available at172.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.

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 your Docker containers add the following line to your 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/squid3/, you can use docker exec. For example, if you want to tail the access logs:

docker exec -it squid tail -f /var/log/squid3/access.log

You can also mount a volume at /var/log/squid3/ so that the logs are directly accessible on the host.

docker squid---but git proxy should specify by git config --global http.proxy http:...的更多相关文章

  1. 解决Failed with error: unable to access 'https://git.coding.net/chenmi1234/lianpos.git/': Couldn't resolve host 'git.coding.net'

    代码改变世界 github push 出现问题 Failed with error: unable to access 'https://git.coding.net/chenmi1234/lianp ...

  2. [Jenkins][git]构建时提示Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git reset --hard" returned status code 128:

    --------------------- 如需转载,转载请注明出处. --------------------- 今日发现所有IOS构建相关的job全部失败,并提示如下错误: ERROR: Erro ...

  3. 使用GIT进行源码管理——GIT托管服务2018

    我曾经介绍过几个在线的GIT托管服务,然而时过境迁,发生了不少变化,便写了此文章,在新的一年重新更新一下:   国外托管网站: 国外托管网站比起国内的来相对靠谱点,但一个主要缺点是网速较慢,并且可能在 ...

  4. Git初探--笔记整理和Git命令详解

    几个重要的概念 首先先明确几个概念: WorkPlace : 工作区 Index: 暂存区 Repository: 本地仓库/版本库 Remote: 远程仓库 当在Remote(如Github)上面c ...

  5. CentOS7 编译安装 Git 服务器 Centos 7.0 + Git 2.2.0 + gitosis (实测 笔记)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 服务器IP:192.168.1.31 域 ...

  6. 版本管理之Git(二):Win7上Git安装及简单配置过程

    一.安装包 msysgit(Windows版本的Git) 下载地址:http://code.google.com/p/msysgit/downloads/list?q=full+installer+o ...

  7. 【Git学习笔记】初始化Git仓库和版本回退

    学习地址 http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 什么是版本库呢?版本库又 ...

  8. git的使用,通过git上传修改工程

    一:下载git,https://git-scm.com/downloads(若下载速度慢,可下载百度下的)接下来,默认配置,一直next 二:在github上注册账号,并新建一个项目test(英文有点 ...

  9. Git学习(一)——Git介绍与安装

    一.Git诞生 Linus在1991年创建了Linux,从此,Linux系统不断发展,成为最大的服务器系统软件. 2005年,Linus用C编写了一个分布式版本控制工具--Git. 二.集中式vs分布 ...

随机推荐

  1. CDH中flume是已经启动着了…

    文章来自:http://www.cnblogs.com/hark0623/p/4174646.html   转发请注明 在CDH中用了几天flume后才发现,原来CDH中的flume默认是启动的……… ...

  2. hdu2159

    #include<bits/stdc++.h> #define MAX 155 using namespace std; struct Node { int exp; int pat; } ...

  3. Wireshark分析器分析数据流过程

    Wireshark分析器分析数据流过程 分析包是Wireshark最强大的功能之一.分析数据流过程就是将数据转换为可以理解的请求.应答.拒绝和重发等.帧包括了从捕获引擎或监听库到核心引擎的信息.Wir ...

  4. Cyclic Nacklace[HDU3746]

    Cyclic Nacklace Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  5. BZOJ3775 : 点和直线

    设第$i$条直线的解析式为$a_ix+b_iy+c_i=0$,$d_i=a_i^2+b_i^2$,则要求一个点$(x,y)$,使得$\sum\left(\frac{\left|a_ix+b_iy+c_ ...

  6. HDU 4003 (树形DP+背包)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4003 题目大意:有K个机器人,走完树上的全部路径,每条路径有个消费.对于一个点,机器人可以出去再回来 ...

  7. 洛谷 P2024 食物链 POJ 1182 Label:并查集Turbo

    题目描述 动物王国中有三类动物 A,B,C,这三类动物的食物链构成了有趣的环形.A 吃 B,B 吃 C,C 吃 A. 现有 N 个动物,以 1 - N 编号.每个动物都是 A,B,C 中的一种,但是我 ...

  8. TC SRM 584 DIV 2

    第一次在DIV2 AK了. 250水题. 500,FLoyd搞出所有边的最短路,然后找最短路,中最长的,如果有不连通的边返回-1 1000,组合DP,各种慌乱,在最后1分钟时,交上了,感觉很棒,最后还 ...

  9. web应用防火墙 – 安全伞18.5.1免费版本发布

    “Safe3 Web Application Firewall"是国内安全组织保护伞网络基于新一代Web安全技术开发的全方位企业Web信息安全产品.能有效扫描各种WebShell,同时也可以 ...

  10. asp.net 页面过程