Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your ufw rules don't cover your Docker ports (and the log-rotation setting to make before your first container)

Two things bite almost every new Docker host in a homelab. One is a security surprise. The other is a disk that fills up a few weeks later. Both are a five-minute fix if you do them before the first real container. The firewall surprise Docker's own documentation on packet filtering says it plainly: Docker and ufw are incompatible. When you publish a container's port, Docker routes the traffic in…

New Docker hosts often encounter two common issues for first-time users. The first is a security inconvenience, while the second is an unexpected disk space problem. Both can be resolved quickly if addressed before deploying actual containers. Docker's documentation makes it clear that its built-in firewall, ufw, does not work with published container ports.

When you expose a container's port, Docker routes the traffic through its NAT table, bypassing ufw's INPUT chain. Consequently, a simple "deny all" rule won't catch incoming traffic. To avoid this, publish as few container ports as possible. On a well-designed Docker host, only the reverse proxy should publish ports (typically 80 and 443).

All other containers should be accessed through the proxy on an internal Docker network without specifying ports. To access admin tools that need to publish a port, use "127.0.0.1:9000:9000" and connect via an SSH tunnel. Another recommended approach is to set network rules at the router level, and employ Docker's DOCKER-USER chain for container-specific traffic.

Docker's default logging driver, json-file, does not perform any log rotation, which can lead to disk space exhaustion. Docker suggests using either the local driver or rotation options for json-file. These settings should be specified in /etc/docker/daemon.json. For example, setting "log-driver" to "json-file" and "log-opts" with "max-size" of "10m" and "max-file" of "3" limits log file growth.

After making changes to daemon.json, restart Docker using "sudo systemctl restart docker" and confirm the logging driver with "docker info --format '{{.LoggingDriver}}'". A frequent mistake is assuming old containers will automatically pick up the new logging configuration, which they won't. They must be recreated with the updated settings.

Regarding Docker permissions, the post-install documentation cautions that adding users to the docker group grants them root-level privileges, allowing them to mount the entire host filesystem. For a single-admin homelab setup, this is generally fine, but avoid adding service accounts or shared logins to the docker group. If tools need to access /var/run/docker.sock, mount it read-only where necessary and only allow trusted applications to interact with it.

In summary, to prevent common issues when starting with Docker, publish minimal container ports, bind admin tools to localhost or proxy networks, configure router-level access controls, set up log rotation in /etc/docker/daemon.json, and maintain strict control over the docker group permissions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Five Agents, One Dev Database: Clone a Postgres per Worktree With Postgres 18

Book: Database Playbook Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for developers who ship…

  • Five agents cloned Postgres databases per worktree in Postgres 18.
  • Each worktree had its own database copy using filecopymethod.
  • Clone command created databases named after worktree branches.

This week in Cursor + .NET — 7 rules (week ending October 18, 2026)

Every weekday a single, opinionated rule for senior C#/.NET engineers using Cursor. Here's the full week in one read — canonical posts live on the Agentic Architect blog .

  • Controllers should not contain database logic; keep queries in Infrastructure layer
  • Structured logging with ILogger and templates for Cursor pattern recognition
  • FluentValidation on every MediatR Request to prevent context rot

I built an attention head out of a 1982 associative memory and measured where it breaks

The second-biggest story on Hacker News this morning (590 points) is titled "You could have invented transformers from memory" — the argument, in one line, is that attention is what you get when you…

  • Attention in neural networks can be understood as a differentiated version of associative memory.
  • Hopfield network and attention head were implemented in the same code to test the claim.
  • Associative memory degrades gradually with increasing patterns and poor input cue quality.

More from Sunday 18 October →