I try to put a squid in a docker image via following Dockerfile:
FROM ubuntu:22.10
ENV TZ="Europe/Berlin"
ENV APT_HTTP_PROXY="Acquire::http::proxy \"http://192.168.0.2:8080/\";"
ENV APT_HTTPS_PROXY="Acquire::http::proxy \"http://192.168.0.2:8080/\";"
ENV APT_FTP_PROXY="Acquire::http::proxy \"http://192.168.0.2:8080/\";"
ENV DEBIAN_FRONTEND=noninteractive
# insert modified config
COPY squid.conf.tp /etc/squid/
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
echo $APT_HTTP_PROXY >> /etc/apt/apt.conf && \
echo $APT_HTTPS_PROXY >> /etc/apt/apt.conf && \
echo $APT_FTP >> /etc/apt/apt.conf && \
apt-get update --yes -q && \
apt-get install --yes -q squid && \
rm -rf /var/lib/apt/lists/* && \
/usr/sbin/squid -z
VOLUME ["/squid_data"]
EXPOSE 3128
CMD ["/usr/sbin/squid", "-f /ecc/squid/squid.conf.tp", "--foreground", "-s", "-Y", "-C"]
but squid does not start with error:
FATAL: Unable to open configuration file: /ecc/squid/squid.conf.tp: (2) No such file or directory
When I modify the CMD into:
CMD ["/usr/bin/ls", "-alh", "/etc/squid" ]
I got
drwxr-xr-x 3 root root 6 Jul 22 11:33 .
drwxr-xr-x 43 root root 96 Jul 22 12:24 ..
drwxr-xr-x 2 root root 3 Jul 22 11:33 conf.d
-rw-r--r-- 1 root root 1.8K Jun 21 17:38 errorpage.css
-rw-r--r-- 1 root root 334K Jun 21 17:38 squid.conf
-rw-r--r-- 1 root root 334K Jul 21 14:00 squid.conf.tp
everything looks good to me, I can't see the problem. Without the -f option, squid starts as expected (but with the wrong config).
It's my first contact with docker, obviously, I got something wrong, but what.