Dozzle is a simple, lightweight application that provides you with a web based interface to monitor your Docker container logs live. It doesn’t store log information, it is for live monitoring of your container logs only.
While dozzle should work for most, it is not meant to be a full logging solution. For enterprise applications, products like Loggly, Papertrail or Kibana are more suited.
Dozzle doesn't cost any money. Dozzle aims to stay simple, small and free.
Getting dozzle
Dozzle is a very small Docker container (4 MB compressed). Pull the latest release from the index:
$ docker pull amir20/dozzle:latest
Using dozzle
The simplest way to use dozzle is to run the docker container. Also, mount the Docker Unix socket with --volume
to /var/run/docker.sock
:
$ docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:8080 amir20/dozzle:latest
dozzle will be available at http://localhost:8888/. You can change -p 8888:8080
to any port. For example, if you want to view dozzle over port 4040 then you would do -p 4040:8080
.
With Docker swarm
docker service create \
--name=dozzle \
--publish=8888:8080 \
--constraint=node.role==manager \
--mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
amir20/dozzle:latest
With Docker compose
version: "3"
services:
dozzle:
container_name: dozzle
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 9999:8080
Security
dozzle doesn't support authentication out of the box. You can control the device dozzle binds to by passing --addr
parameter. For example,
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:1224 amir20/dozzle:latest --addr localhost:1224
will bind to localhost
on port 1224
. You can then use a reverse proxy to control who can see dozzle.
If you wish to restrict the containers shown you can pass the --filter
parameter. For example,
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:1224 amir20/dozzle:latest --filter name=foo
this would then only allow you to view containers with a name starting with "foo". You can use other filters like status
as well, please check the official docker command line docs for available filters.
Changing base URL
dozzle by default mounts to "/". If you want to control the base path you can use the --base
option. For example, if you want to mount at "/foobar",
then you can override by using --base /foobar
. See env variables below for using DOZZLE_BASE
to change this.
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle:latest --base /foobar
dozzle will be available at http://localhost:8080/foobar/.
Environment variables and configuration
Dozzle follows the 12-factor model. Configurations can use the CLI flags or enviroment variables. The table below outlines all supported options and their respective env vars.
Flag |
Env Variable |
Default |
--addr |
DOZZLE_ADDR |
:8080 |
--base |
DOZZLE_BASE |
/ |
--level |
DOZZLE_LEVEL |
info |
--showAll |
DOZZLE_SHOWALL |
false |
n/a |
DOCKER_API_VERSION |
not set |
--tailSize |
DOZZLE_TAILSIZE |
300 |
--filter |
DOZZLE_FILTER |
"" |
Troubleshooting
Nginx Config
If you are using nginx as a reverse proxy, then you need to configure /api
to enable server-sent events.
Below is an example configuration using SSL and proxy_pass
with correct settings.
server {
listen 80;
server_name <example.com>;
return 301 https://<example.com>$request_uri;
}
server {
listen 443 ssl http2;
server_name <example.com>;
ssl_certificate </path/to/your/certificate>;
ssl_certificate_key </path/to/your/key>;
location / {
proxy_pass http://<dozzle.container.ip.address>:8080;
}
location /api {
proxy_pass http://<dozzle.container.ip.address>:8080;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding off;
}
}
License
MIT
Building
To Build and test locally:
- Install NodeJs.
- Install Go.
- Globally install packr utility with
go get -u github.com/gobuffalo/packr/packr
outside of dozzle directory.
- Install reflex with
get -u github.com/cespare/reflex
outside of dozzle.
- Install node modules with
npm install
.
- Do
npm start