Dockerfile
# 使用arm32v7/alpine作为基础镜像
FROM arm32v7/alpine:latest
# 替换为阿里云源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add --no-cache curl
# 更新apk包索引并安装squid,apache2-utils用于创建用户和密码
RUN apk update && apk add apache2-utils && apk add squid
# 配置Squid的基本设置(可根据需要自定义)
COPY squid.conf /etc/squid/squid.conf
# 删除squid.pid文件
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# 开放Squid代理的端口,默认为3128
EXPOSE 3128
ENTRYPOINT ["/entrypoint.sh"]
squid.conf
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.