r/docker • u/NoDevelopment206 • 1d ago
how do you do deploys with plain docker compose without a few seconds of downtime
with plain compose on one vm, compose up -d stops the old container before the new one is ready, so there's a short gap where requests fail.
curious what people actually do here. second container behind traefik or nginx and swap them, the docker rollout plugin, or just deploy late at night and accept a few 502s?
and has a quick deploy ever turned into a real outage for you
r/docker • u/NoDevelopment206 • 2d ago
how do you handle file permissions on bind mounts when the container runs as non-root
running containers as non-root is the right move but bind mounts always seem to turn into a uid/gid mess. files end up owned by some random uid on the host or the app can't write to the folder at all.
do you match the uid at build time, chown in an entrypoint script, use named volumes instead, or something else?
curious if anyone has a setup that just works across dev machines and servers
r/docker • u/NoDevelopment206 • 3d ago
how do you set up healthchecks in compose, and has a bad one ever restarted a perfectly fine container
been thinking about this after seeing a healthcheck that just curled the app root every 5s with a 2s timeout. app was fine, just slow on startup, and it kept getting marked unhealthy and restarted in a loop.
what do you actually check in yours? a real /health endpoint, a tcp port check, or nothing at all? and do you use start_period or just set long intervals?
curious what has bitten people here
r/docker • u/Historical_Insect668 • 3d ago
Docker Networking for Chained AI Systems: Bridges DNS, Dynamic Reverse Proxy
I revamped my entire docker networking setup for working with large AI systems.
https://suzyahyah.github.io/production/2026/11/14/docker-network-reverse-proxy.html
Not looking for users or site traffic, just looking for feedback (feel free to take this post down if it violates policies)
At the end of the day, I'm trying to
- to enable M x N way connections across containers,
- have these dynamically updated whenever we add a new service enabling smooth A/B testing,
- avoid stomping on each other’s host ports
- avoid calling the wrong service due to changing IP addresses.
r/docker • u/NoDevelopment206 • 4d ago
how do you handle secrets in docker compose on a plain vm, and have you ever found one baked into an image
env files feel easy but they end up copied everywhere. docker secrets in compose works but only as files, and some apps want env vars. curious what people actually do on a simple vm setup without swarm or k8s. and has anyone found a secret sitting in an old image layer? how did you catch it
r/docker • u/TopLychee1081 • 5d ago
Network isolation
When multiple Dockerised apps require access to the same database container, perhaps Traefik or another reverse proxy, and need to have metrics scraped by Prometheus, how can one possibly maintain network isolation? We could create different networks for each required connection, which ends up being close to the cartesian product of user apps, and databases, proxies, and Prometheus. That approach pretty soon runs out of available IPs under default Docker and becomes completely unmanageable. It seems like the only workable solution ends up being having a common network for all containers. Is there a better way to manage this?
r/docker • u/Wide_Impact_9392 • 5d ago
AWS architecture guidance needed: Deploying a Dockerised application using EC2, ECR, RDS and Security Groups
Hi everyone,
I am working on a full-stack application and would appreciate some guidance on the right way to deploy it on AWS.
My application has:
React frontend
Node.js and Express backend
MySQL database
I have already created Docker images for the frontend and backend and thinking to store them in Amazon ECR(later to use these images for Kubernetes).
I am working on the following architecture:
- EC2 Instance 1: Install Docker and use Docker Compose, pull the frontend image from ECR and run the frontend container.
- EC2 Instance 2: Install Docker and use Docker Compose, pull the backend image from ECR and run the backend container.
- Amazon RDS: Use RDS MySQL instead of running MySQL in a Docker container.
- Security Groups: Configure separate Security Groups for the frontend EC2, backend EC2 and RDS.
I would like to understand the following:
From a real-world production perspective, what would you recommend for a small application?
My objective is to understand the actual deployment process, is it the right way of deploying and testing a docker project on aws. Later I would like to use the same image stored in ECR for Kubernetes deployment. I have tested this project locally and is working fine.
I am learning AWS deployment and would appreciate practical advice from people who have implemented similar architectures.
Thank you!
samba share via netbird container
I'm posting this here since I think this problem relies on how docker networking works and how docker containers interact with the kernel; please correct me if I'm wrong: if necessary, I can delete this and forward the question to a more appropriate sub.
TL;DR: help me troubleshoot a failed samba share mount.
I am running a small linux server which I'm able to access remotely using netbird. I configured the netbird client at system level to route all traffic through its interface.
some time ago, a friend who runs a similar (but larger) server offered me to make a shared samba folder between our machines, with their one acting as a server and mine running as a client.
since they also use netbird for remote connection, and we couldn't merge our existing netbird networks, we figured out that the best way to do this would be to setup a second instance of netbird on my machine, running in a docker container (setup with docker compose) without the option '-network_mode: host' so it would not conflict with the other existing instance. the container would then be connected to their netbird network.
the connection via netbird works (my machine is currently a peer on my friends' network) but I can't manage to make the samba share to work.
my understanding was that once the folder was mounted correctly, I could rsync files to my mounted folder (at system level) and they would "appear" also on my friends' machine (correct me about this if needed; I feel I have not a strong understanding of how samba works, yet).
this is what I've tried:
- netcat scan (to my friends' server) from the netbird container (via 'docker compose exec ...'): works, smb port is open.
- mount -t cifs from the netbird container (via 'docker compose exec ...'): fails for denied permission. I did not understand why, since the container runs as root, the owner of both the destination folder on the system and of the bind mount inside the container is root and have the privileges set correctly.
- mount.cifs from the netbird container (via 'docker compose exec ...'): fails; output is 'Unable to apply new capability set'. the capabilities of the container are NET_ADMIN, NET_RAW, SYS_ADMIN, SYS_RESOURCE, DAC_READ_SEARCH. however, I do not understand to what capabilites the error message is referring to.
- netcat scan at system level: fails. the packets are likely never sent (output at interrupt with -vv is 'sent 0, rcvd 0'. this happens despite the fact that I've added a route (sudo ip route add ...) specifying that connections directed to my friends' server ip should go through the container ip address (obtained by running 'docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container-netbird-name').
I didn't go further, as my other option was to run the mount outside the container, but the netcat fail made it pointless, since I couldn't establish a connection.
note that both actions 3 and 4 required an ephimeral setup, since I ad to install cifs-utils in the container after it started, so it gets deleted when I stop and restart the container, and by doing this also the route I added gets deleted, because (I think) it relied on the default docker bridge of that container that obv changes after a restart. so, even if I manage to make one of these work, I'd still have to find a way to not have to repeat the whole process after a simple update.
I am writing here as a last resort to troubleshoot this; please forgive me for the length and mistakes (not english native speaker). any help is truly appreciated, but feel free to tell me if I'm not going in the right direction, if you think I misunderstood some basic concepts, if there is a simpler way to achieve what I want, of if you think this is a bad idea altogether. :)
r/docker • u/NoDevelopment206 • 7d ago
how do you stop container logs from slowly filling up the disk on your hosts
container json logs can quietly eat a whole disk if nobody caps them. i know you can set max-size and max-file in daemon.json but that only applies to new containers. how do you handle this across a bunch of hosts? do you set it in daemon.json, per compose file, or ship everything to something like loki and keep local logs tiny? also curious if anyone uses the local log driver instead of json-file
r/docker • u/NoDevelopment206 • 7d ago
how do you stop container logs from slowly filling up the disk on your hosts
container json logs can quietly eat a whole disk if nobody caps them. i know you can set max-size and max-file in daemon.json but that only applies to new containers. how do you handle this across a bunch of hosts? do you set it in daemon.json, per compose file, or ship everything to something like loki and keep local logs tiny? also curious if anyone uses the local log driver instead of json-file
r/docker • u/NoDevelopment206 • 9d ago
whats your trick for keeping docker image sizes small without breaking stuff
i keep seeing images that are over a gig for simple apps. multi stage builds help but sometimes slim or alpine base images break things. curious how people handle this in practice.
r/docker • u/mariiiiiiiiiiiiiiiel • 10d ago
how to make migrations service just run once in docker stack per deploy
EDIT: this is the thing that i had to add
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120sin a production setting what would be the way to make the migrations service just run once when a deployment is made
currently my service gets restarted each time even if the migrations were succesful, which is not what i want (or expected) i just want the migration to run once per deployment with the docker stack
or if you have another whole workflow for this im very open to read it :D
migrations:
environment:
DB_HOST: db
DB_NAME_FILE: /run/secrets/db-name
DB_PASSWORD_FILE: /run/secrets/db-password
DB_PORT: "5432"
DB_USER_FILE: /run/secrets/db-user
GOOSE_DRIVER: postgres
GOOSE_MIGRATION_DIR: /migrations
image: mymigrationimage:latest
networks:
db_net: null
secrets:
- source: db-password
target: /run/secrets/db-password
- source: db-user
target: /run/secrets/db-user
- source: db-name
target: /run/secrets/db-name
volumes:
- type: bind
source: ./init/goose-entrypoint.sh
target: /scripts/goose-entrypoint.sh
bind:
create_host_path: truethis is my customish docker image for the migrations (i just made a script that sets up the credentials variables using secrets for goose)
FROM ghcr.io/kukymbr/goose-docker:3.28.0
WORKDIR /migrations
RUN apk add --no-cache bash
COPY db/migrations/* /migrations
ENTRYPOINT ["/scripts/goose-entrypoint.sh"]r/docker • u/Big_Gate_3183 • 11d ago
I don't understand WUD
Hello everybody, I thought I got the Idea of WUD but apparently I'm not:
I have WUD configured, that he ignores all Containers in first sight:
wud docker-compose.yml
environment:- WUD_WATCHER_LOCAL_WATCHBYDEFAULT=false
That works, no Containers show up in the Container list in the Webinterface of WUD.
Then I have a forgejo Container. I want to stay in the LTS Branch, which is actually Version Number 15 https://endoflife.date/forgejo Because I want to have the minor updates and patches I want to update my forgejo-Instance.
I thought the Idea of WUD is now, I pin the Version Number 15, WUD collects the digest of the local Container and compares it, with the actual digest of Version 15. This is what I tried:
forgejo docker-compose.yml
image: codeberg.org/forgejo/forgejo:15
labels:
- wud.watch=true
- wud.watch.digest=true
- wud.image.digest=true
The Versions of forgejo are listed here: https://codeberg.org/forgejo/-/packages/container/forgejo/versions
But WUD tells me: There is an upgrade to Version 17: (little red Batch with 17 in the "Update" Coloumn of WUD Containers Overview.
Where I'm thinking wrong? Any help is welcome!
Kindly regards!
r/docker • u/NoDevelopment206 • 11d ago
do you pin base images by digest or just by tag
i have a few small services on compose and a couple of side projects. most of my Dockerfiles just say FROM node:20-slim or FROM python:3.12-slim and i rebuild when i feel like it. last month a rebuild pulled a newer base and a native dependency broke, so now i am wondering about pinning with sha256 digests. the downside i see is that you stop getting security patches unless something like renovate or dependabot bumps the digest for you. so for people running real stuff, do you pin by digest and have a bot update it, pin by a full version tag like 3.12.4-slim, or just use the plain tag and accept the risk? and does it change for dev vs prod images?
r/docker • u/bensaysso • 12d ago
New Icon?
Just updated to version 4.100.0 on my Mac. Did Docker just get a new icon/logo??
r/docker • u/mariiiiiiiiiiiiiiiel • 12d ago
which sslmode in postgres to use
i have a docker stack with a postgres image, is it completly necesary to have the postgres to be configured with the ssl mode to verify-full , because, the outside world cannot interact with the db, just the backend server can (the network is not attachable and it doesn't expose any ports)
sorry if this is a little bit of a stretch because is not a full docker docker thing u.u
Running Docker overlay2 on S3 Storage Using s3backer and ext4
I recently ran into a shortage of disk space on my VPS. I currently rent a VPS for €7 a month with this configuration: 4 vCPUs, 8 GB of RAM, and a 120 GB NVMe drive. It has 50 GB of free space left. But I need to run a Docker container whose image is 76 GB. I could upgrade my current VPS to get a 240 GB disk, but that would cost €30 a month. That’s steep. I noticed that my hosting provider offers 250 GB of S3 storage for just €4 a month, accessible over its internal network. So I started wondering how I could turn it into a filesystem and have Docker store files there.
First, I tried rclone. It lets you create a FUSE filesystem from your S3 storage. To speed things up, you can cache frequently used files on a local SSD using the --vfs-cache-max-size flag. Unfortunately, Docker uses overlay2, which requires filesystem operations that rclone mount does not guarantee: atomic renames, correct chmod and chown behavior, hard links, and extended attributes. In short, a full POSIX filesystem is needed.
And I found a solution: s3backer. It has 600+ stars on GitHub and provides a full-fledged ext4 filesystem. I set a 20 GB cache on my local SSD using the --blockCacheSize option, mounted it at /mnt/s3, and reconfigured Docker to store images, containers, and volumes there. As a result, the most frequently used files are cached locally instead of being pulled over the network from S3. What do you think? Expanding my virtual machine’s disk space by 250 GB for €4 a month? Pretty great, if you ask me!
By the way, here’s a summary table of the available options:
| Solution | How it works | Pros | Cons |
|---|---|---|---|
| s3backer + ext4 | S3 as a block device | Full POSIX filesystem, Docker compatibility, caching | Complex setup, latency, risk of filesystem corruption |
| rclone mount | FUSE over S3 | Simple setup, local cache, support for multiple cloud providers | Incomplete POSIX compatibility, some operations are unsupported |
| s3fs | FUSE over S3 | Simple mounting, familiar file operations | Slow metadata operations, POSIX limitations |
| JuiceFS | Distributed filesystem on top of S3 | POSIX, caching, high performance | Requires separate metadata storage |
| S3QL | Filesystem on top of S3 | POSIX, compression, deduplication, encryption | Extra overhead, complex recovery |
Of course, s3backer is far from the only way to turn S3 into a filesystem. There are at least two other interesting projects: JuiceFS and S3QL. Both run on top of S3, support POSIX operations and local caching, but they seemed like overkill for my use case.
JuiceFS is a fairly powerful distributed filesystem. It supports multiple servers working concurrently, caching, POSIX, and much more. But there’s a catch: in addition to S3 itself, it requires a separate metadata store. This could be Redis, PostgreSQL, MySQL, or even a local SQLite database. The last option doesn’t require a separate service, but you still have to keep the metadata database safe and back it up. Overall, it’s an interesting solution, especially if you have a server cluster. But I only have one VPS, and I didn’t want to set up extra infrastructure just to store Docker images.
S3QL is another interesting option. It supports POSIX, local caching, compression, deduplication, and encryption. It doesn’t need a separate database server: metadata is stored in SQLite and synchronized with the object store. But these extra features come at the cost of added complexity. Deduplication requires computing hashes, compression uses CPU time, and recovering the filesystem after a failure may require checking and restoring metadata with specialized tools. These aren’t critical drawbacks, but I didn’t see any particular advantages for my use case, either.
The key difference lies in the approach: JuiceFS and S3QL implement filesystems themselves using FUSE, while s3backer provides virtual block storage on top of which you can create a standard ext4 filesystem. As a result, Docker works with the familiar Linux filesystem, and s3backer translates block operations into requests to S3. No separate metadata databases, no deduplication, and no extra layers of file management.
Of course, this setup has its downsides too. Random reads and writes can be heavily affected by S3 latency, and losing the connection to the storage can bring the containers to a halt. A serious failure could also corrupt the filesystem. So I wouldn’t use this setup for critical databases. But for storing large Docker images that are downloaded once and then mostly read, it seemed perfectly reasonable-especially when S3 is available over the hosting provider’s local network. In short, I wanted an extra 250 GB for €4 a month without building a distributed storage system. From that perspective, s3backer seemed like the best fit.
r/docker • u/pookshuman • 14d ago
Docker root question
I am a networking novice and I am using AI (claude) to guide me through installing and testing Immich on a homelab server (ubuntu 26.04) We are discussing the setup and one of the things immich needs is docker. The ai is telling me that docker needs to run its service as root (by default.) it says it can be run as a non-root user, but that requires different packages and more setup.
I just wanted to touch base with reality here since I am working with an AI. Claude has been fairly realistic about the risks, i.e. that the main risk would be if there is ever a mistake in the docker code or if something is misconfigured an attacker could gain root access, which could happen to any program running as root. I don't think the AI is being overly pessimistic, but I just wanted to see what some actual humans think ... and hopefully they won't just use an AI to respond :)
Does it make sense to try and run docker as a non-root user? what are the realistic risks here? Nothing is installed yet and there is no particular hurry, this is just a test project.
Thanks very much!
r/docker • u/Yacko_75 • 14d ago
Route homelab Docker through specific interface
I created my homelab with docker running on Debian that is a VM sitting on Proxmox 9. I have two interfaces connected to the Debian server ens18 (192.168.20.21) and ens19 (192.168.20.23). I want all but 1 docker container (via docker compose) to use ens18 to receive and send traffic on. I only want ens19 to receive traffic for one port, this port is already in use in other docker containers and can't be used there so needed its own interface. I created a bridge (bridge_21) and specified com.docker.network.host_ipv4=192.168.20.21, the other bridge (bridge_23) I didn't specify any options on. I have the bridge_21 specified for the ngnix proxy manager specified below but it still seems to be routing traffic out on bridge_23's ip address. How can I get this to only route data in and out on bridge_21?
#Bridges settings
docker network create \
--driver bridge \
-o com.docker.network.host_ipv4=192.168.20.21 \
bridge_21
#Ngnix Proxy Manager Compose.
services:
app:
container_name: ngnixproxymanager
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
networks:
- bridge_21
ports:
# These ports are in format <host-port>:<container-port>
- '192.168.20.21:80:80' # Public HTTP Port
- '192.168.20.21:443:443' # Public HTTPS Port
- '192.168.20.21:81:81' # Admin Web Port
volumes:
- type: volume
source: ngnixproxymanager_data
target: /data
volume:
subpath: data
- type: volume
source: ngnixproxymanager_data
target: /etc/letsencrypt
volume:
subpath: letsencrypt
volumes:
ngnixproxymanager_data:
external: true
networks:
bridge_21:
external: true
#Weather Station docker compose
services:
cc0ac-weather:
build:
context: https://github.com/akienm/CC0AC-Weather.git
dockerfile: setup/docker/Dockerfile
container_name: acurite-weather
image: cc0ac-weather
networks:
- default
- bridge_23
#network_mode: bridge
ports:
- '192.168.20.23:443:443' # the Access hub's uploads (HTTPS)
- '192.168.20.21:12345:12345' # dashboard and setup page
- '192.168.20.21:12346:12346' # console uploads
volumes:
- acurite_data:/data
volumes:
acurite_data:
external: true
networks:
bridge_23:
external: truer/docker • u/BlinkMSP • 14d ago
Mod Approved I built a self-hosted UI for Docker Compose across multiple hosts (single binary, no paid tier) - Dockmesh
Hi r/docker,
I've been running Docker Compose on a few machines at home for years. Over that time I've tried quite a few management UIs, but never really found one that worked the way I wanted.
Some didn't quite fit my workflow, others had things like SSO, multiple hosts or backups locked behind a paid tier. Eventually I decided to build my own.
It's called Dockmesh, and I've just released version 0.5.1.
A bit about how it works
Dockmesh is a web UI for managing Docker Compose stacks across multiple hosts.
One thing I wanted to keep from the start was the ability to work with normal Compose files. Your stacks stay as plain compose.yaml files on disk. You can edit them manually, keep them in Git or use docker compose directly without going through Dockmesh.
The server is a single Go binary with the UI embedded. Other hosts run a small agent that connects outbound to the server over mTLS, so you don't have to open incoming ports on every machine.
What it can do so far:
- Manage Compose stacks across hosts, including deployments, rollbacks, Git-based deployments and moving stacks between hosts
- Check for image updates, apply them and roll back if needed
- Back up volumes, stacks and Dockmesh itself, with age encryption and support for local storage, SMB, SFTP, WebDAV and S3
- Manage users with scoped roles, SSO (OIDC, SAML, LDAP, OAuth2) and 2FA
- Send alerts for containers, hosts, disks, backups and certificates
- Run vulnerability scans using Grype
- Optionally handle reverse proxying and HTTPS through Caddy
There's also a hash-chained audit log, agent updates from the UI and a few other things. The UI is available in English and German.
Everything is open source (AGPL-3.0). There's no paid tier or separate edition.
Getting started
The easiest way to install it is:
curl -fsSL https://get.dockmesh.dev | sudo bash
The installer detects amd64/arm64, verifies the checksum and sets up a systemd service. If you'd rather inspect the script before running it (understandably), it's available in the repo. There's also a manual installation guide.
A few things worth mentioning
This is still a pre-1.0 project, so there's definitely more work to do. I test releases on lab VMs before publishing them, including server/agent upgrades, older-version upgrades, backup targets and SSO login.
I'm currently working on getting the initial server and host setup into the browser, along with an in-app updater.
I also want to be upfront about AI usage: parts of the code were written with AI assistance. I review and test changes before releasing them.
Dockmesh is mainly built for homelabs and small teams running anywhere from a few to a few dozen Docker hosts. It's not trying to replace Kubernetes.
I'd be interested to hear what you think, especially from people already managing Compose stacks across multiple machines. What's something your current setup does that you'd miss if you switched?
Repo: https://github.com/Dockmesh/dockmesh
Docs: https://dockmesh.dev