Code Monkey home page Code Monkey logo

Comments (8)

amir20 avatar amir20 commented on June 11, 2024

Thanks for the details. I don't know podman well and wouldn't be the best person to set it up and test it. However, looking at your compose file I think I spot a mistake. You shouldn't need to use DOCKER_HOST and mount /var/run/docker.sock. You only need to mount it if you plan to use the sock file OR DOCKER_HOST for a remote connection.

In this case, I think removing DOCKER_HOST should work.

from dozzle.

amir20 avatar amir20 commented on June 11, 2024

Also, what is localhost/dozzle:latest? Are you building yourself?

from dozzle.

seaborn-sandia avatar seaborn-sandia commented on June 11, 2024

Thank you for the quick response, I appreciate it. I have yet to use the socket service rootlessly so I am no expert either. Oh okay, the DOCKER_HOST is for external host monitoring, that makes sense. I went ahead and removed the environment variable but ran into the same issue.

$ cat podman-compose.yaml
version: "3"

services:
  dozzle:
    container_name: dozzle
    image: localhost/dozzle:latest
    volumes:
      - $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock
    ports:
      - 9999:8080

$ podman-compose up
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.6.1
** excluding:  set()
['podman', 'ps', '--filter', 'label=io.podman.compose.project=dozzle', '-a',
'--format', '{{ index .Labels "io.podman.compose.config-hash"}}']
['podman', 'network', 'exists', 'dozzle_default']
podman create --name=dozzle \
  --label io.podman.compose.config-hash=690bb931e8b7283a32523343f1b0a6c6aba1151959ea73490370417bac5c0951 \
  --label io.podman.compose.project=dozzle --label io.podman.compose.version=1.0.6 \
  --label [email protected] --label com.docker.compose.project=dozzle \
  --label com.docker.compose.project.working_dir=/home/ahdial/Documents/development/containers/dozzle \
  --label com.docker.compose.project.config_files=podman-compose.yaml \
  --label com.docker.compose.container-number=1 --label com.docker.compose.service=dozzle \
  -v /run/user/1001/podman/podman.sock:/var/run/docker.sock --net dozzle_default --network-alias dozzle \
  -p 9999:8080 localhost/dozzle:latest
e0b7dc25cdf12ff1c7bbf72a108932adda860aee036253b97c562c2fa7ae7864
exit code: 0
podman start -a dozzle
time="2024-04-22T17:18:40Z" level=info msg="Dozzle version v6.5.1"
time="2024-04-22T17:18:40Z" level=fatal msg="Could not connect to any Docker Engines"
exit code: 1

Oh good question about the image. I am pulling the Dozzle 6.5.1 image and then relabeling it as a localhost image for reasons. It's the same image as the 6.5.1 image available on Dockerhub, I just smacked on another label and called it through there.
Just as a sanity check, I ensured that the sock was owned by my user and thus available for my services to reach.

$ ll /run/user/1001/podman/podman.sock
srw-rw----. 1 1001 1001 0 Apr 22 09:29 /run/user/1001/podman/podman.sock

I have tried a few different formulations of the sock path including specifying it directly as /run/user/1001/podman/podman.sock instead of using the $XDG_RUNTIME_DIR environment variable but no use so far.

Thank you again for helping me to debug this.

Edits: spelling

from dozzle.

amir20 avatar amir20 commented on June 11, 2024

Try enabling debug --level debug and let me know what that prints. It sounds like something is not connecting locally.

from dozzle.

seaborn-sandia avatar seaborn-sandia commented on June 11, 2024

Good idea, I specified it in the podman-compose file.

version: "3"

services:
  dozzle:
    container_name: dozzle
    image: localhost/dozzle:latest
    volumes:
      - $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock
    ports:
      - 9999:8080
    environment:
      - DOZZLE_LEVEL=debug

It looks like it is a permissions issue afterall but I'm not sure how to go about resolving it. What do you think?

exit code: 0
podman start -a dozzle
time="2024-04-22T18:21:37Z" level=info msg="Dozzle version v6.5.1"
time="2024-04-22T18:21:37Z" level=debug msg="filterArgs = {map[]}"
time="2024-04-22T18:21:37Z" level=debug msg="Could not connect to local Docker Engine: permission denied
while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?all=1\":
dial unix /var/run/docker.sock: connect: permission denied"
time="2024-04-22T18:21:37Z" level=debug msg="Local Docker Engine not found"
time="2024-04-22T18:21:37Z" level=fatal msg="Could not connect to any Docker Engines"
exit code: 1

from dozzle.

amir20 avatar amir20 commented on June 11, 2024

Ah interesting. I wouldn't know too much about it as it seems to be specific to podman.

I'll have to do some digging when I get a chance. Unfortunately, I am only on a Mac so it wouldn't be easy to replicate though.

I wonder if you can use curl --unix-socket /var/run/docker.sock http://localhost/v1.44/containers/json

If you can get that to work first then theoretically it should work with Dozzle.

from dozzle.

seaborn-sandia avatar seaborn-sandia commented on June 11, 2024

Oop, it was a podman issue. As someone described in a podman-related issue: operations on the podman sock require that the container be run with the --privileged flag. I went ahead and added that flag to my compose file like so:

version: "3"

services:
  dozzle:
    container_name: dozzle
    image: localhost/dozzle:latest
    privileged: true
    volumes:
      - $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock:ro
    ports:
      - 9999:8080
    environment:
      - DOZZLE_LEVEL=debug

Bring that container online rootlessly but with the privileged flag resulted in a successful start.

podman start -a dozzle
time="2024-04-22T19:06:17Z" level=info msg="Dozzle version v6.5.1"
time="2024-04-22T19:06:17Z" level=debug msg="filterArgs = {map[]}"
time="2024-04-22T19:06:17Z" level=debug msg="Connected to local Docker Engine"
time="2024-04-22T19:06:17Z" level=info msg="Connected to 1 Docker Engine(s)"
time="2024-04-22T19:06:17Z" level=info msg="Accepting connections on :8080"
time="2024-04-22T19:06:17Z" level=debug msg="subscribing to docker events from container store localhost"
time="2024-04-22T19:06:17Z" level=debug msg="Post \"https://b.dozzle.dev/event\": tls: failed to verify certificate: x509: certificate signed by unknown authority"

Thank you for helping me to debug this!

from dozzle.

amir20 avatar amir20 commented on June 11, 2024

That's awesome! Woohoo.

from dozzle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.