Squid in docker, help please
Tags: squid, proxy, help, discuss
Published: 2019-07-12 01:35:45

---
title: Squid in docker, help please
published: true
description: Squid in docker
cover_image: https://thepracticaldev.s3.amazonaws.com/i/gb0c98rrinzghg13f39f.png
tags: squid,proxy,help,discussion
---

Well, I was planning a splashy introduction of the squid in docker that I use, but unfortunately, I wasn't able to make it working, from the time that I started the whole [squid caching server](http://www.squid-cache.org/) series. So~~~ embarrassing... So, now, let me proudly present, after such long suspension, 

.

.

.

my~~~ _failure_. :-) Sorry, I'm still unable to get [the thing](https://github.com/alatas/squid-alpine-ssl) working. Here is the error that I get:

```
$ docker-compose up
Creating network "squidalpinessl_default" with the default driver
Pulling squid-alpine-ssl (alatas/squid-alpine-ssl:latest)...
latest: Pulling from alatas/squid-alpine-ssl
c67f3896b22c: Pull complete440e6ed511b8: Pull complete847023064f29: Pull completea9feff2a3c77: Pull complete76bf3e160a3a: Pull complete24048ab52d48: Pull complete39519a455c0c: Pull completeDigest: sha256:9c80c62244e3c703b6870d39d95b1bfd3c9c4906a7011bc6563701bc63af81e6
Status: Downloaded newer image for alatas/squid-alpine-ssl:latest
Creating squidalpinessl_squid-alpine-ssl_1 ... 
Creating squidalpinessl_squid-alpine-ssl_1 ... error

ERROR: for squidalpinessl_squid-alpine-ssl_1  Cannot start service squid-alpine-ssl: OCI runtime create failed: /var/lib/docker/overlay2/1fd063e74f933d24df8530b72dfaea6d4db76aebe42d95bd93bb9f952b2f607c/merged is not an absolute path or is a symlink: unknown

ERROR: for squid-alpine-ssl  Cannot start service squid-alpine-ssl: OCI runtime create failed: /var/lib/docker/overlay2/1fd063e74f933d24df8530b72dfaea6d4db76aebe42d95bd93bb9f952b2f607c/merged is not an absolute path or is a symlink: unknown
ERROR: Encountered errors while bringing up the project.

```

Note that, 

- The above is pulling the _"last-good"_ version of it, when it was supposed to work -- otherwise, people won't upload broken images to docker hub. But still, it is not working. 
- I tried to [update everything to latest](https://github.com/suntong/squid-alpine-ssl), but it is still failing on me. 
- In fact, I trimmed it down to the following simple docker file, and it is still _Not.Working_!:

```
$ cat Dockerfile 
FROM alpine:latest

RUN apk add --no-cache \
    squid \

$ docker build -t squid-alpine . 
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM alpine:latest
 ---> 4d90542f0623
Step 2/2 : RUN apk add --no-cache     squid
 ---> Running in 190963a80f2d
failed to update store for object type *libnetwork.endpointCnt: Key not found in store
```

So now I _declare my failure_, and will move on to Ubuntu based solution instead. 

Of course, anyone who is reading this, and knows the solution, I'll be more than happy to hear from you. Thanks!

**UPDATE:**

Thanks to all the help from @andrelinslima, which stirred me into the right direction for troubleshooting, I've now solved all the problems, including the problem from Ubuntu based solution:

```
$ sudo docker-compose up
Pulling Squid (sameersbn/squid:3.5.27-2)...
3.5.27-2: Pulling from sameersbn/squid
5b7339215d1d: Pull complete14ca88e9f672: Pull completea31c3b1caad4: Pull completeb054a26005b7: Pull completeb75c98eb6264: Pull completeb2b9f1f84321: Pull completeDigest: sha256:e98299069f0c6e3d9b9188903518e2f44ac36b1fa5007e879af518e1c0a234af
Status: Downloaded newer image for sameersbn/squid:3.5.27-2
Creating dockersquid_Squid_1 ... 
Creating dockersquid_Squid_1 ... error

ERROR: for dockersquid_Squid_1  Cannot start service Squid: failed to update store for object type *libnetwork.endpointCnt: Key not found in store

ERROR: for Squid  Cannot start service Squid: failed to update store for object type *libnetwork.endpointCnt: Key not found in store
ERROR: Encountered errors while bringing up the project.
```

I'm including all the error messages here in hoping that the next person looking for them might find the solution here. 

It has nothing to do with the docker base, whether `alpine` or `ubuntu`. 
As @andrelinslima has pointed out that, it is a local config problem. As for the solution, the hints comes from [here](https://github.com/docker/compose/issues/2356):

- _"It's internal docker daemon error"_
- _"I moved my docker images folder when I faced this problem."_
- _"For those suffering this issue, I reset my docker twice and it started working."_

Indeed, it was caused by me moving my docker images folder, and the solution is simple to restart the docker service:

```
% /etc/init.d/docker restart
[ ok ] Restarting docker (via systemctl): docker.service.
```