# 编译 ./configure --prefix=/app/squid --enable-linux-netfilter --enable-gnuregex --with-default-user=squid --enable-ltdl-convenience && make -j`nproc` && make install && echo ok ## 输出ok正常 make[2]: 对“install-exec-am”无需做任何事。 make[2]: 对“install-data-am”无需做任何事。 make[2]: 离开目录“/root/squid-5.9” make[1]: 离开目录“/root/squid-5.9” ok
# 检测 root@192-168-3-11:~/squid-5.9# cd /app/squid root@192-168-3-11:/app/squid# ls bin etc libexec sbin share var root@192-168-3-11:/app/squid# ./sbin/squid -v Squid Cache: Version 5.9 Service Name: squid configure options: '--prefix=/app/squid''--enable-linux-netfilter''--enable-gnuregex''--with-default-user=squid''--enable-ltdl-convenience'
# 创建测试容器 root@192-168-3-11:~# docker run -itd --name test --rm -p 3128:3128 squid:v5.9 8e77d57feea060224444547d13c7dd9b7bd997434428cc879e20150390d58d49 root@192-168-3-11:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8e77d57feea0 squid:v5.9 "docker-entrypoint.s…" 20 seconds ago Up 18 seconds 0.0.0.0:3128->3128/tcp, :::3128->3128/tcp test
# 容器进程 docker exec -it test ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND squid 1 0.5 14.6 567604 145104 pts/0 Ss+ 06:19 0:00 squid -N -d1 -f /app/squid/etc/squid.conf squid 7 0.0 0.1 5648 1800 ? Ss 06:19 0:00 (logfile-daemon) /app/squid/var/logs/access.log squid 8 20.0 0.4 8100 4012 pts/1 Rs+ 06:19 0:00 ps aux
# 实时日志 root@192-168-3-11:~# docker exec -it test tail -f /app/squid/var/logs/access.log