The Fastest Way to Debug Docker Containers (Dozzle)

BBetter Stack
Computing/SoftwareInternet Technology

Transcript

00:00:00You could keep debugging Docker with five terminals and endless scrolling.
00:00:04Or you could open one browser window and see all your container logs live.
00:00:08This is Dozzle.
00:00:10An open source real time log viewer that streams container logs live to your
00:00:13browser and doesn't actually store them.
00:00:15That's why it stays so tiny around seven megabytes and fast.
00:00:19Let's see how you can set this up and put it to real use right now.
00:00:22[MUSIC]
00:00:28You might have three terminals open, maybe five.
00:00:30We're running Docker logs on each one.
00:00:32We're scrolling, searching, switching tabs.
00:00:35That's just the cost of working with containers.
00:00:37Dozzle now gives us a simpler way to see everything live in one place
00:00:41without building a whole logging stack.
00:00:43It supports Docker, Docker swarm, Kubernetes and
00:00:46multi-host setups using agents plus version 10 just dropped.
00:00:50Which adds alerts, web hooks, cloud support and important security updates.
00:00:54It's built for one thing, live visibility while you debug.
00:00:57Time to show you how to set it up and
00:00:59why it can completely change how you debug Docker apps.
00:01:02If saving time in your development workflow matters to you, subscribe.
00:01:06We're always covering practical tools to make a difference.
00:01:09Now on the outside, Dozzle sounds like another logging tool.
00:01:12We expect something heavy, something that stores data,
00:01:15something that needs a database, but it's kind of the opposite here.
00:01:19Let's set it up in less than 60 seconds.
00:01:22First, pull the image with the command that I run right here.
00:01:26I'm going to run it, mount the Docker socket and expose the port, that's it.
00:01:30There's no database, there's no indexing and I don't have to wait around.
00:01:33I switched up my ports because I'm already running other containers,
00:01:37one of which uses the standard one.
00:01:39Now I can just open my browser, open localhost and
00:01:42we immediately see our containers running.
00:01:44The thing you expect from setup just never shows up.
00:01:47This just runs really well.
00:01:49If you use Docker Compose to find a service with the image, map the port,
00:01:53mount the Docker socket and pass in the no analytics flag.
00:01:56Then run Docker Compose up, you're done.
00:01:59The only real things to watch for are socket permissions and
00:02:02making sure you're running version 10 or newer if you want the latest updates.
00:02:07That's the entire setup loop.
00:02:08It's nothing crazy here, but the UI and practicality of this is.
00:02:13Now here's where all this will hopefully click.
00:02:16When you open Dozzle, you see a clean list of all your running containers.
00:02:20There's no real dashboards, so it's just our services.
00:02:24I can start typing in the search bar like DB.
00:02:27And instantly your database container appears, no exact naming required.
00:02:32Click a container and log start streaming live.
00:02:35We don't need to refresh anything, it just does this for us.
00:02:38I made a dummy container to simulate failing requests, but
00:02:41if you have an app of yours already, just try to trigger a failed request.
00:02:46As soon as that error happens, it appears in the browser.
00:02:48I don't have to switch terminals, I'm not rerunning commands.
00:02:51The moment something breaks, I'm gonna see it right here in the interface.
00:02:54In version 10, there's SQL mode powered by Duck DB.
00:02:58You can switch modes in the terminal and run a query like selecting entries.
00:03:03This is super basic here, but I could make a query and
00:03:05it's gonna be returned here in Dozzle, okay?
00:03:07But it gives us the idea.
00:03:09So instead of scanning with our eyes, we can now just query logs.
00:03:13You can also define a condition if you want like CPU usage going above 80% and
00:03:17attach a webhook to Slack or another endpoint,
00:03:20which makes this feel a lot more interactive.
00:03:22That was one of the features in the newest update.
00:03:24Before you expose this outside your local machine,
00:03:27make sure you enable authentication.
00:03:29Set the environment and variable and
00:03:31provide a user's configuration file that just protects access.
00:03:35Now in Kubernetes, deploy it using Manifests or Helm.
00:03:38Mount the necessary logs and expose through a service.
00:03:42Just two final thoughts before I move on here.
00:03:44Now, I wanna be clear about what this is and what this isn't.
00:03:48Dozzle is a simple, lightweight, and focused on live streaming.
00:03:52It doesn't store logs, that keeps it fast and more privacy friendly.
00:03:57But it also means it's not built for long term retention.
00:04:00So do that with what you will.
00:04:02If you need persistent storage and dashboards,
00:04:04there are countless better choices out there that we're already using.
00:04:07But for live streaming open source ways to analyze the containers,
00:04:11I found this pretty cool.
00:04:13Every minute you spend switching terminals,
00:04:15scanning logs is time you're not fixing the problem.
00:04:18Dozzle hopefully removes that, at least it appears to do so.
00:04:22It centralizes your logs, adds filtering SQL queries and split views, and
00:04:27also adds alerts in version 10, all without becoming too heavy or complex.
00:04:31Set it up in your next Docker project, see how quickly you can spot issues.
00:04:35If you found this helpful, be sure to subscribe for more dev focused content.
00:04:39We'll see you in another video.

Key Takeaway

Dozzle offers a high-performance, minimalist solution for real-time Docker log streaming that replaces complex terminal workflows with a searchable and queryable web interface.

Highlights

Dozzle is a lightweight, open-source real-time log viewer for Docker that remains around 7MB due to its no-storage architecture.

The tool provides a centralized browser-based interface, eliminating the need to manage multiple terminal windows for container logs.

Version 10 introduces advanced features including SQL-based log querying via DuckDB, webhooks for Slack alerts, and cloud support.

Setup is extremely fast (under 60 seconds) by mounting the Docker socket and requires no external databases or indexing.

While excellent for live debugging and privacy, it is not intended for long-term log retention or persistent data storage.

Timeline

Introduction to Dozzle and the Problem of Terminal Overload

The video opens by contrasting the inefficient traditional method of debugging using multiple terminal windows against the streamlined approach of Dozzle. Dozzle is introduced as an open-source, real-time log viewer that streams data directly to the browser without persistent storage. This architectural choice allows the application to remain incredibly lightweight at roughly seven megabytes. The speaker highlights compatibility with Docker, Docker Swarm, and Kubernetes, specifically noting that version 10 has just launched with new alerting features. This section establishes the value proposition for developers seeking a simpler way to gain visibility into container activities.

Rapid Setup and Technical Deployment Guide

The speaker demonstrates how to set up Dozzle in under 60 seconds by pulling the official image and mounting the Docker socket. Key deployment steps include exposing the necessary port and optionally passing a no-analytics flag for privacy. The guide covers both direct Docker commands and Docker Compose configurations, emphasizing the absence of complex databases or indexing requirements. Crucial tips regarding port conflicts and socket permissions are provided to ensure a smooth installation process. This rapid deployment cycle underscores the tool's focus on immediate developer utility and low overhead.

Exploring the User Interface and Real-Time Debugging

Once launched, the user is presented with a clean, dashboard-free interface that lists all running containers for easy navigation. The search functionality allows for quick filtering, enabling developers to find specific containers like databases without typing exact names. Live streaming starts automatically upon clicking a container, which is demonstrated using a dummy container to simulate request failures. Errors appear instantly in the browser, eliminating the need to refresh or switch back to the command line. This real-time feedback loop is presented as the primary driver for speeding up the debugging process.

Advanced Features: SQL Mode and Alerting

Version 10's standout feature is the introduction of SQL mode, which is powered by DuckDB and allows users to query logs directly. Instead of manual visual scanning, users can select specific entries or filter logs using standard SQL queries for better precision. The update also includes conditional alerting, such as triggering a Slack webhook if CPU usage exceeds 80%. Security is addressed with instructions on how to enable authentication by setting environment variables and providing a user configuration file. Deployment strategies for Kubernetes are also briefly mentioned, involving manifests or Helm charts to expose the service.

Summary: When to Use Dozzle vs. Traditional Log Stacks

The video concludes with a frank assessment of Dozzle's intended use cases and its inherent limitations. The speaker clarifies that because the tool does not store logs, it is not suitable for long-term data retention or historical analysis. It is positioned as a focused, privacy-friendly alternative to heavy logging stacks when the goal is immediate troubleshooting. By centralizing logs, adding filtering, and providing split views, Dozzle aims to recover time lost to terminal hopping. The speaker encourages developers to integrate it into their next project to experience the efficiency gains first-hand.

Community Posts

No posts yet. Be the first to write about this video!

Write about this video