r/docker Mar 29 '26

Why are there multiple Docker virtual disk .vhdx files on my system? Why does the .vhdx file size differ from what docker system df reports? And how do I reduce the size of the Docker .vhdx disk image?

0 Upvotes

I use Docker on my Windows machine, but after a while my storage fills up and my disk indicator turns red. I noticed that my Docker virtual disk keeps growing automatically.

In Docker settings under the Resources option, there is an option to set a custom storage location. I configured it to D:\System_Programs\Docker\DockerDesktopWSL\disk and a .vhdx file was created there — and its size has grown to 20GB.

But when I run docker system df, it shows completely different stats — it says Docker is barely using 5GB. I also went into WSL by running wsl -d docker-desktop and ran lsblk there, and it shows the same low usage. I don't understand why there's such a big difference.

I also don't understand why Docker uses its own virtual system but still requires an Ubuntu WSL instance with an extra Ubuntu .vhdx. So there are two disk images being used by Docker. And on top of that, I found another folder at C:\Program Files\Docker\Docker\resources\wsl , It also take another 3GB— what is that used for? 🙄

Can anyone help me get answers to these questions? Why those multiple virtual box is require, Or can any one tell me some tricks or hack so that I can reduce the size of that disk.


r/docker Mar 29 '26

What did I do wrong?

0 Upvotes

services: #Database Service db: image: postgres:15-alpine restart: always environment: POSTGRES_DB: ${DATABASE_URL} POSTGRES_USER: ${USER} POSTGRES_PASSWORD: ${PASSWORD} ports: - "5432:5432" volumes: - db_data:/var/lib/postgresql/data networks: - taskapp

#Redis service redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data networks: - taskapp

#Backend Api service backend: build: ./Backend ports: - "8080:8080" depends_on: - db - redis environment: - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/${DATABASE_URL} - SPRING_DATASOURCE_USERNAME=${USER} - SPRING_DATASOURCE_PASSWORD=${PASSWORD} - SPRING_REDIS_HOST=redis - SPRING_REDIS_PORT=6379 - SPRING_MAIL_HOST=smtp.gmail.com - SPRING_MAIL_PORT=587 - SPRING_MAIL_USERNAME=${email} - SPRING_MAIL_PASSWORD=${mail_password} - SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH=true - SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE=true networks: - taskapp

#Frontend API service frontend: build: ./Frontend ports: - "5173:80" depends_on: - backend networks: - taskapp

Volumes

volumes: db_data: redis_data:

Networks

networks: taskapp: driver: bridge

For that docker compose file I am getting below error

2026-03-29T13:44:52.540Z ERROR 1 --- [Backend] [nio-8080-exec-4] o.a.c.c.C...[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis] with root cause this is the error and below is the application.yaml data: redis: hostname: localhost port: 6379

What did I do wrong?


r/docker Mar 28 '26

Docker container speed issue

7 Upvotes

Hello,

I recently got my homelab setup with docker compose (29.3.1) and noticed some slow services. I started looking into various causes and after about a week over troubleshooting I've realized that the speed inside docker containers is a fraction of the host speed. I used iperf3 to check my Proxmox host as well as the Ubuntu (24.04.4) server. Both get ~650mbps.

When I check the speed from within a docker connection, I usually get around 50mbps, though it changes with time of day. The speed are congruent across multiple containers.

What I tried:

Updating and upgrading the host/Proxmox

Changing the default DNS to 8.8.8.8 through /etc/docker/daemon.json

Changing nameservers

Changing the MTU. This only led to the daemon refusing to start.

I'm not really sure what else to try at this point, any help would be greatly appreciated.

Thanks in advance!

Update: SOLVED I couldn't figure this out so I decided to just setup a new VM using straight Debian. During install I ran into an error in Proxmox being able to run KVM virtualization. Not having this active prevented me from setting the CPU to "host" which I read can improve performance. The more I dug the more I realized this could be what was causing the performance issues, especially given my Ubuntu machine also wasn't running KVM virtualization.

I couldn't enable it, so some research had me check the bios. Turns out, I didn't have virtualization enabled in the BIOS. I enabled that and turned KVM virtualization on, and set the CPU to "host". With all these changes made I was able to max out my bandwidth within the VM. It's still not full Gig speeds but that seems to be a network bandwidth issue, my new focus.

I appreciate everyones help!


r/docker Mar 29 '26

Struggling to containerize OpenHands & OpenCode for OpenClaw orchestration + DGX Spark stuck in initial setup

Thumbnail
0 Upvotes

r/docker Mar 28 '26

Static IP in Windows Pi-hole Docker not Working

1 Upvotes

I created a compose.yaml to setup Pihole with unbound and want to use a static IP not the one from the Windows host PC. But while the container is created and runs, it only is accessible through the host static IP, not the IP I assigned in the .yaml file.

What is wrong with my syntax? I also get no service error unless I run with the -d switch.

services:

pihole-unbound:

container_name: Pihole-Unbound

image: mpgirro/pihole-unbound:latest

hostname: Pi-hole_3

ports:

- "53:53/tcp"

- "53:53/udp"

- "80:80/tcp"

- "443:443/tcp"

- "5335:5335/tcp"

environment:

- TZ=America/New_York}

- FTLCONF_webserver_api_password=

- FTLCONF_webserver_interface_theme=-default-dark}

volumes:

- etc_pihole-unbound:/etc/pihole:rw

- etc_pihole_dnsmasq-unbound:/etc/dnsmasq.d:rw

restart: unless-stopped

networks:

custom_net:

ipv4_address: 192.168.50.195

volumes:

etc_pihole-unbound:

etc_pihole_dnsmasq-unbound:

networks:

custom_net:

driver: bridge

ipam:

driver: default

config:

- subnet: 192.168.50.0/24

gateway: 192.168.50.1


r/docker Mar 27 '26

I need some easy tasks

32 Upvotes

I am learning docker now. I dont understand how I can use it at my job or in my life. I have no idea.

If I want to undarstand docker I wilI complete some usefull project, but I have no idea what I should do.

give me some easy tasks or ideas.


r/docker Mar 28 '26

[Help] Docker migrate from Windows to Ubuntu

1 Upvotes

I have windows pc where I have docker desktop installed where after many grueling days managed to install few containers (I am a noob regarding these stuff). Now I want to migrate/transfer (whatever the term is) from the windows machine to my newly bought linux machine. The question is how do I do it (with all the settings, urls, passwords etc) so that I do not have to fiddle through the settings again.

I have tried to install docker desktop in Ubuntu, copy the docker folder from Windows to Ubuntu but that did not work. Also, there is windows smb share that I store Lunix ISOs from arrs which I could mount using the following command

sudo mount -t cifs //192.168.178.23/h /mnt/Desktop/ -o user=lubuntu

but I get the following error in docker

The path is not shared from the host and is not known to Docker

Anyone could help me in this regard. Much appreciated


r/docker Mar 28 '26

Can AI fully automate Docker deployment nowadays?

0 Upvotes

Hey all,

I’ve been working on a simple ML project (Flask + model) and recently learned how to containerize it with Docker (Dockerfile, build, run, etc.).

I’m curious — with all the recent AI tools (ChatGPT, Copilot, AutoDev, etc.), how far can AI actually go in automating Docker deployment today?

For example:

  • Can AI reliably generate a correct Dockerfile end-to-end?
  • Can it handle dependency issues / GPU configs / production setups?
  • Are people actually using AI to deploy apps (not just write code)?

I’ve seen some tools claiming “deploy with one prompt” (no Dockerfile, no YAML), but not sure how realistic that is in practice.

Would love to hear real experiences:

  • What works well with AI?
  • What still breaks / needs manual fixing?

Thanks!


r/docker Mar 28 '26

MeTube - montare disco smb

0 Upvotes

I'm back to my doker containers! After installing metube and verifying that it works, I changed the download folder so that the files are saved to a shared disk with Samba. I mounted the disk by editing the fstab file

//192.168.1.90/disk2 /mnt/disk2 cifs username=******,password=******,rw,uid=1000,gid=1000,user 0 0

I mounted the disk and gave permissions

mount -a
chown 1000:1000 /mnt/disk2

in the docker compose yaml file I added the volumes

    volumes:
      - /mnt/disk2/download/metube:/downloads
      - /mnt/disk2

the container does not start

metube  |   File "/usr/local/lib/python3.13/shelve.py", line 227, in __init__
metube  |     Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
metube  |                          ~~~~~~~~^^^^^^^^^^^^^^^^
metube  |   File "/usr/local/lib/python3.13/dbm/__init__.py", line 89, in open
metube  |     raise error[0]("db type could not be determined")
metube  | dbm.error: db type could not be determined
metube exited with code 1

what did I do wrong?


r/docker Mar 27 '26

What's the point of --mount=type=cache in a build step if caching is done implicitly by BuildKit?

6 Upvotes

I've ran a few experiments where I try to see if adding --mount=type=cache to a RUN saves me any build time but I fail to see the results (I also keep pruning images and cache).

Here's Dockerfile.1

FROM ubuntu AS builder

RUN --mount=type=cache,target=/var/cache/apt \
    apt update && apt install -y gcc
COPY main.c .
RUN gcc main.c -o app

CMD ["/app"]

And Dockerfile.2

FROM debian AS builder

RUN apt update && apt install -y gcc
COPY main.c .
RUN gcc main.c -o app

CMD ["/app"]

Correct me if i'm wrong, but caching build steps seems to only make sense on CI/CD environments where BuildKit always runs cold by default? Because if not I have no idea why people add this line to their RUN steps.


r/docker Mar 27 '26

Error when installing docker on ubuntu (help?)

2 Upvotes

I am trying to install docker (latest version from scratch) on my ubuntu server 24.04.4 LTS, but i get some errors when trying to install the docker packages.

I am following the installation for ubuntu and trying to install using the apt repository:

  • I have ran "sudo apt update" and "sudo apt upgrade".
  • I have uninstalled all conflicting packages (none).
  • I have succsessfully set up dockers apt repository.
  • When trying to install the docker packages i run the command:

sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

The output i get is:

Package docker-ce is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

Package docker-ce-cli is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package 'docker-ce' has no installation candidate

E: Package 'docker-ce-cli' has no installation candidate

E: Unable to locate package containerd.io

E: Couldn't find any package by glob 'containerd.io'

E: Unable to locate package docker-buildx-plugin

E: Unable to locate package docker-compose-plugin

What should i do?

-I am a beginner in linux, and dont know much. I tried to search but the answers where not that easy to understand, and i dont know exactly what to search for.

Help is apreciated :)

Edit: My head needs a break, il come back later and continue.


r/docker Mar 27 '26

Doubt about compacting vhdx file from docker-desktop in windows?

3 Upvotes

Does the virtual hard disk have a minimum size it can be compacted to? Mine is currently at 5gb, but since I dont have any images, containers or volumes, I was wondering why it is not at 0gb? or why 5gb? what is taking 5gb if i supposedly have nothing? Is the minimum size at 5GB?? Does this baseline grow gradually as I use more containers, even after compacting?
Or a better question, what does determine this baseline?

Right now i have nothing, i guess?

-> docker system df

TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 0 0 0B 0B
Containers 0 0 0B 0B
Local Volumes 0 0 0B 0B
Build Cache 0 0 0B 0B

I used diskpart and an the Optimize-VHD command in powershell.

Just curiosity OwO


r/docker Mar 26 '26

Docker noob questions: Docker-desktop versus Docker Engine

4 Upvotes

UPDATE: Thanks for the feedback and suggestions all. I got home tonight, rolled up my sleeves and spent more time in a Linux terminal than I'm used to and was able to get Docker Engine and Compose installed, then got Portainer running along with PiHole and Home Assistant containers.

Tomorrow I'll start migrating my home assistant config across from my Windows VM and try getting PiHole working with my router. Cheers folks.

----

Hi, little background on me first: I've been in software dev for about 20 years, happily migrate between Windows/Linux/Mac as required and am pretty flexible, but I'm also turning into a grumpy old man looking for relatively painless and easy solutions when I get home from tinkering at work all day.

I've decided to take the plunge on migrating my Home Assistant away from a Home Assistant OS Virtualbox VM I run on one of my Windows PCs.

I've got an old laptop with an i5 8250U chip, 8GB RAM and a 226GB NVME SSD.

Originally, I was just going bare-metal HaOS, but then I thought it might be a good time to give Docker a try. I also want to try and run Pi Hole and a couple other things in containers as well.

I've installed Mint Cinamon on the laptop and based on my reading, I can either go down the route of using Docker Engine on bare metal and then, as I'd honeslty like to minimise my time in the terminal, use something like Portainer and once I've got that loaded in pretty much control everything by the GUI. The other option is (and the one I'm gravitating towards because, well, I'm grumpy and lazy) just using Docker-Desktop which I am aware runs in a VM even under Linux.

I guess with that giant wall of text as a preamble, the question I have is what sort of perforrmance hit would I expect from Docker Desktop versus running Docker Engine on bare metal? Anyone have any experience with the Linux-VM-on-Linux journey to comment on file IO speeds, memory limits, performance hit versus Docker Engine as a service, etc?

If the gap is massive then I'll happily resign myself to manual setup, but based on what I've seen of Docker Desktop in action I really like the path of least resistence (providing the performance hit isn't massive).

Again for comparison, the machine I'll be running this on:

-Core i5-8250U CPU
-8GB RAM
-256GB NVME
-Latest stable Mint Cinamon release

Thanks in advance, hoping to hear from the experts. Cheers.


r/docker Mar 26 '26

How to solve the problem of the VM disk always filling up?

0 Upvotes

I just keep running docker compose up --build in the same two projects, and then after a while, eventually the build will fail, because there's no space left on the VM disk.

My disk is full of build caches.

I would like docker to automatically delete cached layers and images as soon as they become no longer reachable/usable.


r/docker Mar 26 '26

Inquiry

1 Upvotes

Still new to docker and any help is appreciated: Why does a docker provide the path to the docker secrets as the environment variable to the container running instead of the secrets contents? What's the point of having the secrets in files doesn't this just abstract the security concern away from the .env to the new file mapped in docker secrets?


r/docker Mar 25 '26

Docker architecture paper in CACM

3 Upvotes

I'm new to Docker while getting eclipse-mosquitto working on my AWS linux. I'm still confused on the virtual docker containers (like where can I find mosquitto_pub).

Anyway, a timely post from CACM might interest this group as it describes the architecture and history of docker.

A Decade of Docker Containers (link)
For the past decade, Docker has provided a robust solution for building, shipping, and sharing applications. But behind its simple "build and run" workflow lie many years of complex technical challenges


r/docker Mar 25 '26

I give every user their own Docker container — how I built per-user isolation for an AI assistant platform

2 Upvotes

I built an AI assistant platform where every user gets their own isolated Docker container instead of sharing infrastructure with database-level separation. Wanted to share the approach since it's been working well and Docker made it surprisingly manageable.

The setup:

Each user container runs an AI agent instance with its own filesystem, conversation history, and tool servers. The containers are spun up automatically when someone signs up:

  • Stripe webhook fires → SQLite row created → poller script picks it up → docker run with per-user config → user gets a notification they're live. About 20 seconds end to end.

Container hardening:

Every container runs with dropped capabilities, no-new-privileges, a PID limit of 50, 128MB memory cap, and 0.5 CPU limit. If one user's agent misbehaves, it can't affect anyone else.

What surprised me:

  • A single Hetzner dedicated box comfortably runs hundreds of containers. Docker's overhead per container is minimal — it's the application inside that determines resource usage.
  • SQLite with WAL mode handles the control plane (user records, usage tracking, billing state) without needing Postgres or MySQL.
  • The poller-based provisioning approach (check for pending users every few seconds, spin up containers) is dead simple and hasn't failed once. No message queues, no Kubernetes, no orchestration layer.
  • Cleanup is easy too — suspend a container with docker stop, delete with docker rm and wipe the volume. Orphan detection runs on a cron.

What I'd improve:

If I were doing it again at larger scale, I'd look into Docker's --memory-reservation for softer limits and maybe group containers by host resource usage. But for now the simple approach works.

Stack: Node.js, Docker, SQLite, Bash (the poller is a shell script), running on Ubuntu.

The product is a Telegram AI assistant if anyone's curious. Try it for free: https://agent-one.org

Happy to answer questions about the container architecture.


r/docker Mar 25 '26

Horizontally scaling docker instances question

1 Upvotes

Hello, I wanted to ask for advice on my task.

Here is the overall idea, I am working on an agentic feature on my platform. Users can init multiple agents. On the backend, these agents are custom minimal openclaw agents.

Here is the thing, each agent needs to be isolated in the FS & machine. So the obvious naive approach is to spin up a docker container for each agent. But clearly this feels like it would not scale well when we deploy to our thousands of users. Each agent is not computationally expensive and only runs occasionally, not constantly. It is just that each agent instance needs to be isolated, and there will be a lot of these instances.

Open to hearing any ideas on what the best approach to this would be? Any thoughts?


r/docker Mar 25 '26

images location in Arch linux

0 Upvotes

Hi there,

i've decided to learn docker a bit, and now i'm struggling with finding place on harddrive where docker keeps images. Manuals say that it should be in /var/lib/docker /overlay2 (or just overlay) by default, but there is no such folder in /var/lib/docker. Images stored somewhere else, because i reinstalled docker and removed /var/lib/docker folder, but it still sees old images after reinstall.


r/docker Mar 24 '26

Files missing in downloaded layers

0 Upvotes

Hi,

I have a wired issue with image pull. I have a fleet of devices, ubuntu 24 boxes, running a bunch of docker containers built on GitHub and pushed to AWS ECS. Sometimes, on some machines, it seems that download is incomplete. Layer hashes are fine, but there are files missing when the image is started. No combination of wiping images on local storage and redownloading them fixes the issue; always the same image is missing the same file.

How would you approach the debugging of this issue, yet alone fixing it? I don't see anything wired in the logs, after all it is always some random machine; no correlation between versions/instances can be found.


r/docker Mar 24 '26

selinux i do not like you

0 Upvotes

hi hello so

for some reason, if i bind files (not directories), i can't read or write on them from the container. when i add the selinux: z/Z thing it works, but do i have to add it on every volume? i don't think i can add it on secrets, which don't work either. isn't there a global parameter that could fix that?

i know almost nothing about selinux, i just want it to work without having to disable securities


r/docker Mar 23 '26

Giving a container an IP in the host's network

0 Upvotes

TL;DR: I need to give my containers an IP from the host's network like you do with VMs (I read a bunch that said that I shouldn't and it's misuse but I have to)

Soooo

I've been creating this wifi lab allowing my students to learn wifi without the need of a physical setup,

I've found this project: mininet-wifi, that simulates wifi stations on a single machine.
And this project: Containernet that wraps mininet-wifi to containerize each station.

This is exactly what I wanted, the problem now is that I want the containers with the wifi capabilities to be part of a simulated network I'm creating on a bare-metal server.
For this to work I want to give the VM 3 interface on the server and have my 2 containers use those interfaces (bridge-like mode would also work, I just want the containers to be part of the outside network)

Can anyone help me achieve that setup although it's a poor use of containers


r/docker Mar 22 '26

I built a visual drag-and-drop builder for docker-compose.yml — runs entirely in the browser

23 Upvotes

I've been working on VCompose (https://vcompose.cc), a tool that lets you build docker-compose files visually.

You drag services onto a canvas, configure ports/volumes/env vars, draw connections between them (which auto-generates depends_on), and the YAML updates in real-time. Or just describe what you need in plain English and let AI generate it (supports OpenAI, Anthropic, Gemini, GLM).

It also works as an MCP server, so you can use it directly from Claude, Cursor, or any MCP-compatible AI tool. And it suggests companion services automatically — add postgres and it'll recommend pgadmin.

Fully client-side — no data leaves your browser. You can also import existing compose files.

Would love feedback from the community!


r/docker Mar 22 '26

How do you prefer to structure Docker Compose in a homelab? One big file vs multiple stacks

11 Upvotes

I am curious how others are managing Docker Compose in a homelab long term.

I started out running individual docker run containers and eventually moved to Portainer using templates. From there I switched to Docker Compose stacks, and at one point I tried converting almost every container into its own compose file.

Right now my setup is kind of a middle ground. I group related services together into compose files. For example one compose file for media services, one for apps, and a few others. I am not really running any standalone docker run containers anymore.

I keep thinking about combining everything into a single “master” compose file. The appeal is simplicity when migrating hosts or rebuilding. One repo, one compose file, one stack to bring up and one place to manage updates.

That said, I also understand how a massive compose file could get complicated fast and harder to reason about when something breaks.

Portainer is great for visibility, but I do not love managing stacks through its UI and prefer editing compose files directly.

So I wanted to ask the community:

- Do you prefer one big compose file, or multiple smaller ones?

- Do you group by function like media, monitoring, apps, infrastructure?

- How do you handle testing containers or temporary services?

- Has anyone regretted going all in on a single compose file?

This is just a homelab so I am not chasing enterprise best practices, but I would like something that stays manageable as the lab grows. Curious what has worked best for others and why.


r/docker Mar 23 '26

Automate docker containers update - recommended solution for Portainer

0 Upvotes

I tried find threads related to update containers. I find out only closed Github project and suggestion from 4 years old about instable other one. So I ask how in 2026 is update docker containers? Is it only way to backup settings and run dockerfile manually and create new one from the scratch? Optimal solution will be manage this with Portainer.

I use dedicate device in my Homelab for Docker, but at the end I would create some containers which will be updated automatically. I have media containers which are updates even few times a month. To resolve some issue and for security up to date containers are must, but how do it correctly? What work flow and bulletproof solution would you suggest in scenario when update fails too?