allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
https://goaccess.io
MIT License
18.12k stars 1.1k forks source link

Prebuilt docker image error #2153

Closed landcraft closed 3 years ago

landcraft commented 3 years ago

I'm trying to use your prebuilt docker image, but whenever I run it, it just shows help then stops. I also noticed that the init says /bin/goaccess --help

Can you help?

allinurl commented 3 years ago

Have you tried running it as indicated here?

landcraft commented 3 years ago

I've used another image, and that one works, so I guess I can close this.

olonsoft commented 3 years ago

I have the same problem here. I am using Caddy server. The docker-compose runs but shows only the (commands) help. docker-compose.yml in folder: goaccess :

version: "3.8"
services:
  goaccess:
    image: allinurl/goaccess
    container_name: goaccess
    restart: unless-stopped
    ports:
      - 7890:7890
    volumes:
      - ./data:/goaccess
      - ~/www/goaccess/index.html:/goaccess/index.html
      - ~/docker/caddy/log/access.log:/goaccess/access.log:ro

in data/goaccess.conf :

log-format CADDY
log-file /goaccess/access.log
output /goaccess/index.html
real-time-html true

create the file

sudo touch ~/www/goaccess/index.html

then start the container but only the help is shown.

If I run cat~/docker/caddy/log/access.log | docker run --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format CADDY - > report.html the report.html is successfully being created.

Is something wrong with the paths? Also I think that you must edit the page https://github.com/allinurl/goaccess/blob/master/DOCKER.md because it mentions that the docker container doesn't use subfolders /srv/{data,html,logs} anymore. But some code examples there, already use /srv/{data,html,logs}

@landcraft what image did you use?

landcraft commented 3 years ago

Get the other image I mentioned in my other comment

olonsoft commented 3 years ago

Get the other image I mentioned in my other comment

@landcraft I am sorry but I can not find any mention of an image.

landcraft commented 3 years ago

Get the other image I mentioned in my other comment

@landcraft I am sorry but I can not find any mention of an image.

https://github.com/GregYankovoy/docker-goaccess

olonsoft commented 3 years ago

@landcraft Thank you but this is an old image. It still has version 1.4 of goaccess.

@allinurl Can you please take a look at my issue? Thank you.

landcraft commented 3 years ago

You might consider opening another issue, as yours sounds quite different to mine...

olonsoft commented 3 years ago

@landcraft I have the same problem with you. When I run the docker image, it shows the help and exits.

samcro1967 commented 3 years ago

@allinurl @landcraft @olonsoft I also see the same issue. Seems the current container is not working.

allinurl commented 3 years ago

@samcro1967 Have you tried running it as indicated here?

samcro1967 commented 3 years ago

@allinurl Apologies. I should have been more clear, running as described in the readme works fine. Running it with a goacces.conf instead is not working as I would expect.

allinurl commented 3 years ago

@samcro1967 sorry about that. you will need use volumes to inject the files. e.g.,

$ echo 'log-format VCOMBINED' > /home/user/goaccess.conf
$ sudo mkdir /srv
$ sudo cat access.log | docker run -v /home/user/goaccess.conf:/srv/goaccess.conf --rm -i -e LANG=$LANG allinurl/goaccess -a -o html -p /srv/goaccess.conf - > report.html
samcro1967 commented 3 years ago

That seems to work. If I am understanding the intent of the container then, it is not to have is so that it can auto start, demonize, and continuously run. Just use something like cron to automate when using the container?

allinurl commented 3 years ago

I've seen/heard folks using it both ways, and actually I'd say most of the time it's been daemonized and run in real-time. Here you can find a bit more regarding the original intent.

samcro1967 commented 3 years ago

I didn't have much luck trying to get it working daemonized in the container, but it works fine with cron. Will circle back to this maybe this weekend. Would ultimately like it working in the container just if nothing else for easier migration/recovery to another machine in the future.