I can't run a Squid container in Docker

Hey everyone,

I need to run Squid inside a Docker container for a project.
Up until now I was using Ubuntu on my Lenovo laptop using this image https://hub.docker.com/r/sameersbn/squid and everything worked just fine.

However, now that I switched to Raspberry Pi 3B+ it doesn’t work anymore because it is only for intel/x86.

I have tried using several different images for my Raspberry but all of them just restart the container over and over again and output different error messages.

The images I tried are:
https://hub.docker.com/r/matrixanger/rpi-squid/tags
https://hub.docker.com/r/woahbase/alpine-squid/tags - armv7l version
https://github.com/sarah278/squid-armhf

While using the commands:

Code: Select all

docker pull <image>

and then:

Code: Select all

docker run --name squid_3135 -d --restart=always --publish 3135:3128
--volume /var/docker/squid/squid.conf:/etc/squid/squid.conf
<image>

But Squid just keeps restarting the container.

Am I using the right Docker images ? Any idea on how to run Squid in a container ?

Thanks a lot !

According to the guidance in https://github.com/sarah278/squid-armhf, one can run an ARM version of squid via

docker run -d -p 3128:3128 sk278/squid-armhf

I haven’t tested this myself, but everything appears to be in order to run on an RPi.

Hey, thanks for trying to help.

I have tried this on my Rasp 4 but the containers just keeps restarting.

Any idea ?

Perhaps the best way to try and troubleshoot the issue is to get the logs from the container. If you were to run the following

docker run -d -p 3128:3128 --name squid sk278/squid-armhf

That will create and daemonize a container named “squid”. Once it starts and restarts, you can get the container logs by running

docker logs squid

Which will hopefully provide you with some guidance on where the errors are occurring that are resulting in the container restarts. You can use variants of the ‘docker logs’ command to obtain earlier or more log lines.

I’d like to know how manage a squid container, because i can’t access file squid.conf.

Can you give us more details about your issue? Where do you need to “access” squid.conf?

I access the container Ubuntu squid, however when I access the squid.conf on Ubuntu container I can’t use text editor how can I edit the file?

You could install an editor (nano, vim) in the container temporarily for testing but the best way is to build a new image based on squid and copy a new file into the image. You can also “bind mount” a the configurationf ile from your host as you can see it in the first post in this topic. Of course you need to copy that file from the container to your host first (or create a new one from scratch)

docker run --rm -it --entrypoint ""  IMAGENAEME  cat /etc/squid/squid.conf > squid.conf