Giter Site home page Giter Site logo

amerkurev / doku Goto Github PK

View Code? Open in Web Editor NEW
283.0 3.0 12.0 2.77 MB

💽 Doku - Docker disk usage dashboard

Home Page: https://docker-disk.space

License: MIT License

Dockerfile 1.06% Makefile 0.75% Go 51.24% HTML 0.43% JavaScript 45.99% CSS 0.53%
docker dashboard disk-space disk-usage monitoring utility devops size-calculation docker-disk-usage

doku's Introduction

Doku

Doku is a simple, lightweight web-based application that allows you to monitor Docker disk usage in a user-friendly manner. The Doku displays the amount of disk space used by the Docker daemon, splits by images, containers, volumes, and builder cache. If you're lucky, you'll also see the sizes of log files :)

Doku should work for most. It has been tested with dozen of hosts.

Build  Coverage Status  GoReportCard  Docker Hub  Docker pulls 

laptop_doku

Getting Doku

Doku is a very small Docker container (6 MB compressed). Pull the latest release from the index:

docker pull amerkurev/doku:latest

Using Doku

The simplest way to use Doku is to run the Docker container. Mount the Docker Unix socket with -v to /var/run/docker.sock. Also, you need to mount the top-level directory (/) on the host machine in ro mode. Otherwise, Doku will not be able to calculate the size of the logs and bind mounts.

docker run --name doku -d -v /var/run/docker.sock:/var/run/docker.sock:ro -v /:/hostroot:ro -p 9090:9090 amerkurev/doku

Use following configuration for docker compose:

version: "3"
services:
  docu:
    image: amerkurev/doku:v0.0.16
    ports:
      - 9090:9090
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /:/hostroot:ro

Doku will be available at http://localhost:9090/. You can change -p 9090:9090 to any port. For example, if you want to view Doku over port 8080 then you would do -p 8080:9090.

Basic auth

Doku supports basic auth for all requests. This functionality is disabled by default.

In order to enable basic auth, user should set the typical htpasswd file with --basic-htpasswd=<file location> or env BASIC_HTPASSWD=<file location>.

Doku expects htpasswd file to be crypted with bcrypt algorithm in the following format:

username1:bcrypt(password1)
username2:bcrypt(password2)
...

this can be generated with htpasswd -nbB command, i.e. htpasswd -nbB test passwd

Supported architectures

  • linux/amd64
  • linux/arm/v7
  • linux/arm64

Special thanks to

The following great works inspired me:

License

MIT

doku's People

Contributors

amerkurev avatar damianszczepanik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

doku's Issues

Multiple remote hosts support - Feature request

Hi,

I know this would require a decent amount of re-architecture, but I would like to throw this in here in case it's convenient to implement in the future.

One instance of Doku can access and report the disk usage of multiple remote docker instances. This would be a great single pane of glass for all instances as well as minimize the installation and upgrade headaches. I have 3 instances in my home lab and multiples instances at work.

This how Dozzle does it as an example.

Thanks a lot for the great app.

Doku not showing any anything - Error in log

Hello!
I'm running this in unraid 6.11.5 with the template from the AppCenter.
I'm seeing this in the logs for Doku:
time="2023-07-16T12:05:57-04:00" level=error msg="failed to execute request: docker disk usage" err="Error response from daemon: a disk usage operation is already running"

What have I done wrong?

RepoTags can be null

In Containers.js - RepoTags can be null
image

Which causes a crash while loading the page
image

After installation, it remains in a loading state

The device is Synology SA6400, with the latest 7.2 firmware;
After installation, it remains in Loading mode;
Is it a problem with my settings, or is it because I have too many groupware containers and files?
9587b43fbd1e3775f40168be7ccf1bf

client version 1.41 is too new

time="2022-07-20T02:33:08Z" level=error msg="failed to get the list of containers" err="Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40"
time="2022-07-20T02:33:08Z" level=error msg="poll: docker version" err="failed to execute request: Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40"
time="2022-07-20T02:33:08Z" level=error msg="poll: docker container list" err="failed to execute request: Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40"
time="2022-07-20T02:33:08Z" level=error msg="poll: docker disk usage" err="failed to execute request: Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40"
time="2022-07-20T02:33:08Z" level=error msg="poll: docker log size" err="failed to execute request: Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40"
time="2022-07-20T02:33:08Z" level=error msg="failed to listen to docker events" err="Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40"
time="2022-07-20T02:34:08Z" level=error msg="failed to listen to docker events" err="Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40"

Maybe rename the project?

Hi there! I think this is a great project (docker should have this sort of thing built in for all the money my org pays them...). My issue is more that the project name is close enough to Dokku (something I maintain), which is a self-hosted PaaS for docker.

I know naming is hard and you might be attached to this name already, but I would appreciate it if you would change the project name so that they aren't potentially confused by folks. It'll also help with discoverability for you since it won't be treated a misspelling of Dokku.

Feel free to ignore this issue if you would rather not rename. Good luck on this endeavor otherwise!

Feature Request - Optimize scan process

I'm using a Synology DS220+ NAS with 4Go HDD. After hours,
I have more than 20 docker applications including Doku.

When I access to my Doku web page, I can't view anything. I think the scan process take too much time because I've a lot of photo (more than 100.000) in multiple directories.

Not sure how Doku works but if it scans all the directories and all files on the NAS to provide informations, it could be usefull to be able to define directories to ignore.

Add feature to hide specific volumes / bind mounts from size calculation

I am using a borgmatic container to backup my data to an external hard drive. This hard drive is mounted with a bind mount into the borgmatic container.
I would like to be able to exclude this directory from the doku views, since it gives a false view of the size of the data that is in use.
Are you open for a PR?

I would add an environment variable containing paths that should be excluded, and filter on them in app/bindmounts/size.go

Show usage for multple disks

Hi again,

Recently I moved my docker-data to another disk to free up space on my boot drive. Now doku shows Docker Disk Space Usage as 13.1 GB but also Disk Usage (21 %) 4.25 GB / 20.6 GB.

image

Are you able to support multiple disks in the webUI?

Example:
image

Thanks!

Feature Request - show host disk size remaining

I just tried out Doku on my Raspberrry Pi using USB boot and it worked great - including the logs!

One thing I was hoping to see was how much space left I have on the Pi's disk (or any host running Docker).

Is this something that could be added?

Some error messages with logs and bind mounts

Just found your project via https://noted.lol/doku-docker-disk-usage-dashboard/
great work!

Tried it in my home lab, get some error messages:

  1. bind mounts seems to work, everything is shown but still message No access to some mounted files or directories Doku doesn't have access to some mounted files or directories and can't calculate the size of these files. appears
  2. logs message: No access to the log files Although log files of the containers are present, the top-level directory (/) on the host machine has not been mounted into the Doku container. Therefore Doku doesn't have access to log files and can't calculate the size of these files.
    nothing is shown there

my system:
Linux xxx 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30) x86_64 GNU/Linux
Docker version 20.10.17

compose:

doku:
  container_name: doku
  image: amerkurev/doku
  environment:
    - BASIC_HTPASSWD=/opt/docker/doku/htpasswd
  labels:
   - ${WATCHTOWER_TRUE}
   - traefik.enable=true
   - "traefik.http.routers.doku.rule=Host(`doku.${HOSTNAME}`)"
   - traefik.http.routers.doku.entrypoints=web-secure
   - traefik.http.routers.doku.tls.certresolver=le
   - traefik.http.routers.doku.tls=true
   - traefik.http.routers.doku.priority=2
   - traefik.http.routers.doku.tls.options=default
   - traefik.http.routers.doku.middlewares=doku
   - traefik.http.middlewares.doku.headers.customresponseheaders.X-Robots-Tag=noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex
   - traefik.http.services.doku.loadbalancer.server.port=9090
  networks:
   - web
  restart: always
  volumes:
   - ${TIMEZONE}
   - ${LOCALTIME}
   - /var/run/docker.sock:/var/run/docker.sock:ro
   - /:/hostroot:ro
   - ${DOCKER_PATH}/doku/htpasswd:/opt/docker/doku/htpasswd

happy to share more info if necessary

Feature Request - Environment variable for defaulting to dark theme

Hey, great project! I'm working on setting up a media server using docker containers, and Doku is a great way for me to keep an eye on disk usage. My goal for my project is to allow anyone to spin up a media server with really good defaults.

I think it would be beneficial to have an environment variable/configuration option to control the default theme for Doku. I prefer the dark theme, but Doku currently defaults to the light theme. It'd be great if I could modify the environment of my docker-compose.yml file to tell Doku to start with the dark theme by default (i.e., with no user action).

Something like DOKU_THEME=<light|dark>.
Then my docker-compose.yml file could look like:

  doku:
    image: amerkurev/doku:v0.0.16
    ports:
      - 9090:9090
    environment:
        DOKU_THEME=dark
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /:/hostroot:ro

This pattern of declarative configuration using environment variables with the DOKU_ prefix is really powerful and I think would be useful for anyone who wants to run Doku in containers.

This is a really great project, thanks for contributing to open source!

Nginx Reverse Proxy Configuration

Hey, Can you shine some light as how we can reverse proxy doku running on docker via nginx (on a subpath, i.e /doku)
I have tried the below config but it resolves to 404 :

location /doku {
proxy_bind $server_addr;
proxy_pass http://127.0.0.1:8127;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Script-Name /dockerdisk;
}

Results in not all files being loaded :

image

Thanks in advance !

Unable to set log level using docker-compose

I'm trying to set the log level to "debug" in portainer, but can't find how to do it. I've no debug traces.

Here is my docker compose file content:

version: "3.9"
services:
  doku:
    container_name: Doku
    image: amerkurev/doku:latest
    mem_limit: 4g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    restart: on-failure:5
    ports:
      - 9090:9090
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /:/hostroot:ro
    environment:
      LEVEL: debug

Bind Mounts Totals Incorrect

Hi, just gave this a whirl tonight, and so far it works great. Nice one @amerkurev !

I did notice one oddity, it seems my bind mount totals adds up all the subdirectories of /volumes as well as the top level /volumes itself, so the total is double what it should.

/var/lib/docker/volumes | 41 GB | 101940 | no | 2022-07-18  07:22:44 +00:00
-- | -- | -- | -- | --
/var/lib/docker/volumes/photoprism_pictures | 30.3 GB | 11022 | no | 2022-07-18  07:22:33 +00:00
/var/lib/docker/volumes/photoprism_storage | 9.36 GB | 81521 | no | 2022-07-18  07:22:37 +00:00
/var/lib/docker/volumes/photoprism_database | 275 MB | 157 | no | 2022-07-18  07:22:39 +00:00

image

root@docker-ext ~# du -hc --max-depth=1 /var/lib/docker/volumes
11M	/var/lib/docker/volumes/mumble_data
9.0G	/var/lib/docker/volumes/photoprism_storage
1.1M	/var/lib/docker/volumes/photoprism_import
4.0K	/var/lib/docker/volumes/wger_media
433M	/var/lib/docker/volumes/audiobookshelf_nfs-podcasts
263M	/var/lib/docker/volumes/photoprism_database
1.8M	/var/lib/docker/volumes/librespeed_config
4.0K	/var/lib/docker/volumes/photoprism_data
4.0K	/var/lib/docker/volumes/rss-bridge_config
4.0K	/var/lib/docker/volumes/whoogle_config
6.8M	/var/lib/docker/volumes/mealie_data
12K	/var/lib/docker/volumes/nfs-steven-photos
17K	/var/lib/docker/volumes/audiobookshelf_nfs-audiobooks
8.0K	/var/lib/docker/volumes/wger_redis-data
29G	/var/lib/docker/volumes/photoprism_pictures
4.0K	/var/lib/docker/volumes/wger_static
137M	/var/lib/docker/volumes/tandoor_staticfiles
224M	/var/lib/docker/volumes/monica_db
4.0K	/var/lib/docker/volumes/frigate_config
72M	/var/lib/docker/volumes/tandoor_db
8.0K	/var/lib/docker/volumes/mkdocs_blog
288K	/var/lib/docker/volumes/audiobookshelf_config
1004K	/var/lib/docker/volumes/tandoor_mediafiles
16M	/var/lib/docker/volumes/gotify_data
132K	/var/lib/docker/volumes/codeserver_config
12K	/var/lib/docker/volumes/nfs-steven-uploads
81M	/var/lib/docker/volumes/freshrss_config
53M	/var/lib/docker/volumes/wger_postgres-data
92K	/var/lib/docker/volumes/monica_data
4.0K	/var/lib/docker/volumes/freshrss_data
2.8M	/var/lib/docker/volumes/audiobookshelf_metadata
5.2M	/var/lib/docker/volumes/babybuddy_config
12K	/var/lib/docker/volumes/nfs-melody-photos
39G	/var/lib/docker/volumes
39G	total

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.