From f3b771beba3b633a24b582fd00008bea35bb01bb Mon Sep 17 00:00:00 2001 From: openeuler_bot Date: Sat, 20 Sep 2025 00:06:44 +0000 Subject: [PATCH] 24.03-lts-sp2 update squid to 7.1 --- Cloud/squid/7.1/24.03-lts-sp2/Dockerfile | 32 +++++++++++++++++++++ Cloud/squid/7.1/24.03-lts-sp2/entrypoint.sh | 23 +++++++++++++++ Cloud/squid/README.md | 1 + Cloud/squid/doc/image-info.yml | 1 + Cloud/squid/meta.yml | 4 ++- 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Cloud/squid/7.1/24.03-lts-sp2/Dockerfile create mode 100644 Cloud/squid/7.1/24.03-lts-sp2/entrypoint.sh diff --git a/Cloud/squid/7.1/24.03-lts-sp2/Dockerfile b/Cloud/squid/7.1/24.03-lts-sp2/Dockerfile new file mode 100644 index 00000000..d64dd2c8 --- /dev/null +++ b/Cloud/squid/7.1/24.03-lts-sp2/Dockerfile @@ -0,0 +1,32 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp2 +FROM ${BASE} + +ARG VERSION=7.1 +ARG SQUID_PREFIX=/usr/local/squid +RUN yum -y update && yum -y install wget gcc g++ make perl openssl shadow-utils && yum clean all && \ + wget -O squid.tar.gz https://github.com/squid-cache/squid/releases/download/SQUID_${VERSION//./_}/squid-${VERSION}.tar.gz +RUN mkdir /squid && tar -xvf squid.tar.gz -C /squid --strip-components 1 && \ + cd /squid && ./configure \ + --prefix=$SQUID_PREFIX \ + --enable-arp-acl \ + --enable-linux-netfilter \ + --enable-linux-tproxy \ + --enable-async-io=100 \ + --enable-poll \ + --enable-gnuregex && \ + make -j "$(nproc)" && make install && \ + rm -rf squid.tar.gz /squid && \ + ln -s $SQUID_PREFIX/sbin/* /usr/local/sbin/ && \ + useradd -M -s /sbin/nologin squid && \ + chown -R squid:squid $SQUID_PREFIX/var/ + +COPY entrypoint.sh /usr/local/bin/ +RUN sed -i '$a\cache_effective_user squid' $SQUID_PREFIX/etc/squid.conf && \ + sed -i '$a\cache_effective_group squid' $SQUID_PREFIX/etc/squid.conf && \ + sed -i '$a\visible_hostname 192.168.0.101' $SQUID_PREFIX/etc/squid.conf && \ + sed -i '$a\max_filedescriptors 65536' $SQUID_PREFIX/etc/squid.conf && \ + sed -i '$a\cache_dir ufs /usr/local/squid/var/cache/squid 100 16 256' $SQUID_PREFIX/etc/squid.conf && \ + chmod 755 /usr/local/bin/entrypoint.sh + +ENTRYPOINT [ "entrypoint.sh" ] +EXPOSE 3128 diff --git a/Cloud/squid/7.1/24.03-lts-sp2/entrypoint.sh b/Cloud/squid/7.1/24.03-lts-sp2/entrypoint.sh new file mode 100644 index 00000000..baf2cc58 --- /dev/null +++ b/Cloud/squid/7.1/24.03-lts-sp2/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +# allow arguments to be passed to squid +if [[ ${1:0:1} = '-' ]]; then + EXTRA_ARGS="$@" + set -- +elif [[ ${1} == squid || ${1} == $(which squid) ]]; then + EXTRA_ARGS="${@:2}" + set -- +fi + +# default behaviour is to launch squid +if [[ -z ${1} ]]; then + if [[ ! -d ${SQUID_CACHE_DIR}/00 ]]; then + echo "Initializing cache..." + $(which squid) -N -f /usr/local/squid/etc/squid.conf -z + fi + echo "Starting squid..." + exec $(which squid) -f /usr/local/squid/etc/squid.conf -NYCd 1 ${EXTRA_ARGS} +else + exec "$@" +fi diff --git a/Cloud/squid/README.md b/Cloud/squid/README.md index dca53e6a..159dc1d1 100644 --- a/Cloud/squid/README.md +++ b/Cloud/squid/README.md @@ -17,6 +17,7 @@ Learn more on [Squid website](https://www.squid-cache.org/). The tag of each `squid` docker image is consist of the version of `squid` and the version of basic image. The details are as follows | Tag | Currently | Architectures | |----------|-------------|------------------| +|[7.1-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Cloud/squid/7.1/24.03-lts-sp2/Dockerfile) | squid 7.1 on openEuler 24.03-LTS-SP2 | amd64, arm64 | |[6.8-oe2203sp3](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Cloud/squid/6.8/22.03-lts-sp3/Dockerfile)| Squid 6.8 on openEuler 22.03-LTS-SP3 | amd64, arm64 | # Usage diff --git a/Cloud/squid/doc/image-info.yml b/Cloud/squid/doc/image-info.yml index 226470b1..57aa6687 100644 --- a/Cloud/squid/doc/image-info.yml +++ b/Cloud/squid/doc/image-info.yml @@ -11,6 +11,7 @@ tags: | | Tag | Currently | Architectures | |----------|-------------|------------------| + |[7.1-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Cloud/squid/7.1/24.03-lts-sp2/Dockerfile) | squid 7.1 on openEuler 24.03-LTS-SP2 | amd64, arm64 | |[6.8-oe2203sp3](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Cloud/squid/6.8/22.03-lts-sp3/Dockerfile)| Squid 6.8 on openEuler 22.03-LTS-SP3 | amd64, arm64 | download: | diff --git a/Cloud/squid/meta.yml b/Cloud/squid/meta.yml index f2685da9..e6083a0b 100644 --- a/Cloud/squid/meta.yml +++ b/Cloud/squid/meta.yml @@ -3,4 +3,6 @@ 7.0.2-oe2403sp1: path: 7.0.2/24.03-lts-sp1/Dockerfile 7.1-oe2403sp1: - path: 7.1/24.03-lts-sp1/Dockerfile \ No newline at end of file + path: 7.1/24.03-lts-sp1/Dockerfile +7.1-oe2403sp2: + path: 7.1/24.03-lts-sp2/Dockerfile \ No newline at end of file -- Gitee