diff --git a/squid/6.12/22.03-lts-sp1/Dockerfile b/squid/6.12/22.03-lts-sp1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..698bbd6cc253e7b2f72b18604a43a2edfbb0a904 --- /dev/null +++ b/squid/6.12/22.03-lts-sp1/Dockerfile @@ -0,0 +1,32 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp1 +FROM ${BASE} + +ARG VERSION=6.12 +ARG SQUID_PREFIX=/usr/local/squid +RUN yum -y update && yum -y install wget gcc g++ make perl openssl && yum clean all && \ + wget -O squid.tar.bz2 http://www.squid-cache.org/Versions/v${VERSION%%.*}/squid-${VERSION}.tar.bz2 +RUN mkdir /squid && tar -jxvf squid.tar.bz2 -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/squid/6.12/22.03-lts-sp1/entrypoint.sh b/squid/6.12/22.03-lts-sp1/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..baf2cc58f286147f85a8e3831eaa87323ae67140 --- /dev/null +++ b/squid/6.12/22.03-lts-sp1/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/squid/6.12/22.03-lts-sp3/Dockerfile b/squid/6.12/22.03-lts-sp3/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b7266b04f8debf1261b270cda07af23b8f3ca9f4 --- /dev/null +++ b/squid/6.12/22.03-lts-sp3/Dockerfile @@ -0,0 +1,32 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp3 +FROM ${BASE} + +ARG VERSION=6.12 +ARG SQUID_PREFIX=/usr/local/squid +RUN yum -y update && yum -y install wget gcc g++ make perl openssl && yum clean all && \ + wget -O squid.tar.bz2 http://www.squid-cache.org/Versions/v${VERSION%%.*}/squid-${VERSION}.tar.bz2 +RUN mkdir /squid && tar -jxvf squid.tar.bz2 -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/squid/6.12/22.03-lts-sp3/entrypoint.sh b/squid/6.12/22.03-lts-sp3/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..baf2cc58f286147f85a8e3831eaa87323ae67140 --- /dev/null +++ b/squid/6.12/22.03-lts-sp3/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/squid/6.12/22.03-lts-sp4/Dockerfile b/squid/6.12/22.03-lts-sp4/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..34b1ce86fd88444a1ca0a3287e66e254b5120434 --- /dev/null +++ b/squid/6.12/22.03-lts-sp4/Dockerfile @@ -0,0 +1,32 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp4 +FROM ${BASE} + +ARG VERSION=6.12 +ARG SQUID_PREFIX=/usr/local/squid +RUN yum -y update && yum -y install wget gcc g++ make perl openssl && yum clean all && \ + wget -O squid.tar.bz2 http://www.squid-cache.org/Versions/v${VERSION%%.*}/squid-${VERSION}.tar.bz2 +RUN mkdir /squid && tar -jxvf squid.tar.bz2 -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/squid/6.12/22.03-lts-sp4/entrypoint.sh b/squid/6.12/22.03-lts-sp4/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..baf2cc58f286147f85a8e3831eaa87323ae67140 --- /dev/null +++ b/squid/6.12/22.03-lts-sp4/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/squid/6.12/24.03-lts/Dockerfile b/squid/6.12/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0861b62afb6aed48e6b475eed3322174d676dcde --- /dev/null +++ b/squid/6.12/24.03-lts/Dockerfile @@ -0,0 +1,32 @@ +ARG BASE=openeuler/openeuler:24.03-lts +FROM ${BASE} + +ARG VERSION=6.12 +ARG SQUID_PREFIX=/usr/local/squid +RUN yum -y update && yum -y install wget gcc g++ make perl openssl && yum clean all && \ + wget -O squid.tar.bz2 http://www.squid-cache.org/Versions/v${VERSION%%.*}/squid-${VERSION}.tar.bz2 +RUN mkdir /squid && tar -jxvf squid.tar.bz2 -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/squid/6.12/24.03-lts/entrypoint.sh b/squid/6.12/24.03-lts/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..baf2cc58f286147f85a8e3831eaa87323ae67140 --- /dev/null +++ b/squid/6.12/24.03-lts/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/squid/meta.yml b/squid/meta.yml index bc5afa36149ec02a7deeda7411ae43ac2e95a89c..5d88206f015b812d144c4a19b79d6b2addb7d825 100644 --- a/squid/meta.yml +++ b/squid/meta.yml @@ -1,2 +1,10 @@ 6.8-oe2203sp3: - path: squid/6.8/22.03-lts-sp3/Dockerfile \ No newline at end of file + path: squid/6.8/22.03-lts-sp3/Dockerfile +6.12-oe2403lts: + path: squid/6.12/24.03-lts/Dockerfile +6.12-oe2203sp3: + path: squid/6.12/22.03-lts-sp3/Dockerfile +6.12-oe2203sp4: + path: squid/6.12/22.03-lts-sp4/Dockerfile +6.12-oe2203sp1: + path: squid/6.12/22.03-lts-sp1/Dockerfile \ No newline at end of file