Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Older Docker version #271

Closed
bonny1992 opened this issue Feb 5, 2020 · 12 comments
Closed

Older Docker version #271

bonny1992 opened this issue Feb 5, 2020 · 12 comments

Comments

@bonny1992
Copy link

Is it possible to run this fantastic piece of software using an older Docker version (specifically the 1.18)?

Sadly my Synology DSM doesn't support a newer version of it in the store.

Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): a263667
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): a263667
OS/Arch (server): linux/amd64
@amir20
Copy link
Owner

amir20 commented Feb 5, 2020

Hi @bonny1992. That's so funny because just last week I bought a DS218+ and have been loving it since. I haven't had gotten a chance to try docker on it though.

Have you tried setting DOCKER_API_VERSION? I haven't tested it with your version but it should work. So for you it should be 1.18.

@bonny1992
Copy link
Author

bonny1992 commented Feb 6, 2020

What a coincidence!
Yep, I tried setting the DOCKER_API_VERSION environment variable, so here's my full docker run command:

docker run -d --name dozzle \
 -e DOCKER_API_VERSION=1.18 \
 -v /var/run/docker.sock:/var/run/docker.sock:ro \
 -v /volume1/@docker:/var/lib/docker:ro \
 -p 6000:8080 \
amir20/dozzle

With this particular command, the web gui appear to be working, in the sense that it finds all the currently running containers and their names correctly. But, once you click on any of the containers on the left side of the screen, nothing appears on the right side.
It seems it's constantly waiting for a reply from the api endpoint.

PS: The docker's version shipped with my DSM install is quite... Old, as you can see from the docker version command (it doesn't even support build args!)

EDIT:
Weird. I just tried to recreate the container with root user instead of my usual one but now it gives

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/amir20/dozzle/docker.(*dockerClient).ListContainers(0xc0001db7a0, 0xc1fc01, 0xc0001db7a0, 0x11, 0xc00019df00, 0x1, 0x1)
        /github/workspace/docker/client.go:104 +0x5d0
main.main()
        /github/workspace/main.go:104 +0xf7

@amir20
Copy link
Owner

amir20 commented Feb 7, 2020

@bonny1992 I tried doing a couple of things to debug, but wasn't able to reproduce.

  1. I changed DOCKER_VERSION to 1.18 on my mac. It worked so I am assuming 1.18 supports all APIs dozzle uses. I was able to see the logs. No exception.

  2. I installed Docker on Synolgy but got the latest version where the API version is 1.39.

  3. I tried installing Dozzle and it seems like it worked. I was able to see the Dozzle logs.
    krazyraminfars local_8888_container_60909dc7855e

  4. I looked at the stacktrace and it's here. c.Names[0] is where I try to fetch the container names.

Sadly, I wasn't able to reproduce the error.

Here is what I think is happening. I think the API has changed so much since 1.18 that it used to not return the names and c.Names[0] throws an exception. I could try to hunt down what it does in 1.18 but I'd need to reproduce it.

Are you able to update Docker to 1.39 or is your Synology OS old?

@bonny1992
Copy link
Author

First of all, thanks for trying, @amir20

Sadly I can't update Docker to newer versions because this is the latest I can install on my Synology DSM 5.2

In this version, if this can help, I don't have any of these log drivers, but only a "db" one, probabily something internal for Synology.

Is there any command I could run to help you? Maybe gathering some infos?

@bonny1992
Copy link
Author

Hey @amir20, sorry about the double post but I have a small update on the matter.

I noticed that the logs are shown (but followed) if I restart the container.
To summarize I click on the container I want to see the logs, nothing appears, the via ssh I docker restart dozzle and magically the logs appear on the right side. It works even if I divide the screen between two containers.

I'd attach the log trace of the container but I can't seem to find how to do it via mobile.

@amir20
Copy link
Owner

amir20 commented Feb 7, 2020

No problem @bonny1992. Any details would help.

By any chance, are you running a reverse proxy in front of Dozzle? I ask because live connections sometimes break with improper configuration in Nginx. Restarting it flushes.

I'll need to see what the API returns. Can you try something like this?

curl --unix-socket /var/run/docker.sock http:/v1.18/containers/json

Try to only have one running container when doing this because the output can be huge.

@amir20
Copy link
Owner

amir20 commented Feb 7, 2020

By the way, at some point, I'll have to make a call on how important this is to prioritize. If it's an easy change then I think it's feasible to do it. But if it requires significant branching of code for older versions, then it wouldn't make sense for me to add it. Client v1.6.2 is almost three years old.

Just setting some expectations in case we have to go down a rabbit hole. :)

@bonny1992
Copy link
Author

By any chance, are you running a reverse proxy in front of Dozzle? I ask because live connections sometimes break with improper configuration in Nginx. Restarting it flushes.

I am, it is Caddy.
I just tried and with direct connection over ip:port it works flawlessly.

Is there any particular setting I have to set in the reverse proxy?

Client v1.6.2 is almost three years old.

Man I'm already thankful you at even tried to reproduce the error.
No need to bang our heads if it's not easy or not your software's fault.

@amir20
Copy link
Owner

amir20 commented Feb 7, 2020

Ahhhh. Wonderful. Try reading caddyserver/caddy#1412. I used to have Caddy config but not sure where it is now.

@amir20 amir20 closed this as completed Feb 7, 2020
@amir20
Copy link
Owner

amir20 commented Feb 7, 2020

I do have some config regarding caddy in this bug #6 (comment)

@bonny1992
Copy link
Author

Magnificent, I'll have a try and I'll let you know (of course there is no need to help me in this matter, since it's a different issue!), just for the eventual user that maybe will come through Google.

@bonny1992
Copy link
Author

bonny1992 commented Feb 7, 2020

Big steps forward :)

The gzip entry in my caddyfile blocked the requests, it seems.

Just another question:
Should Dozzle follow the logs as they grow? I mean just like when we do docker logs -f container.
(edit: OK, Dozzle should follow the logs :P I'll open another issue to avoid going OT here)

Because now the logs are showing perfectly, I don't know tho if I should expect it to refresh itself.

Here's my Caddyfile for instance:

mydomain.io {
    proxy / 127.0.0.1:9000 {
        transparent
        websocket
   }
   tls my@email.com
}

@amir20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants