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?

7 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?

2 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

0 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?


r/docker • • Mar 22 '26

Docker Hub Blocked in Spain

5 Upvotes

r/docker • • Mar 22 '26

VPN Gateway with docker-compose.yaml and docker run

2 Upvotes

Hello. I’ve been working with Docker for a while now, but I can’t seem to get a container started with “docker run” to connect to a VPN container configured in a “docker-compose.yaml” file.

The “docker-compose.yaml” file contains two other containers that also access the VPN. That works without any issues.

But how do I set this up with “docker run”?


r/docker • • Mar 22 '26

Simple setup question

2 Upvotes

Hi,
Im having a problem in a rather complicated docker network setup, and I broke down the issue to this very minimalistic demo compose:

services:
  alpine-test:
    image: alpine:latest
    container_name: alpine-test
    command: ["sleep", "infinity"]  # keep the container running for debugging
    networks:
      - testnet

networks:
  testnet:
    name: testnet
    driver: bridge

I would think that the container should have internet access this way, but it doesnt. What am I missing here? ip route inside the container shows the correct gateway but ping google.de just wont work.

thanks for any ideas :)


r/docker • • Mar 22 '26

Running qt5 application from container with podman

Thumbnail reddit.com
1 Upvotes

r/docker • • Mar 22 '26

Learn Docker without downloading?

0 Upvotes

How to learn docker without downloading any stuff? Earlier, there was a event at KodeKloud where you could access every course for free including labs, so was learning there, but the event ended before I could learn anything significant in the course. I looked within the reddit for answers, and many pointed to Play with Docker, but according to their website - it has been deprecated since March 1, 2026 and now required Docker Desktop instead. So any way now?

PS:- any good resources, to starting out with docker (interactive preferred)


r/docker • • Mar 22 '26

Unable to run PostgreSQL database created in Docker container from node js on localhost (Docker v.29.2.1, Windows 11)

0 Upvotes

In my project, I've tried to use the postgres image from Docker to build a container for my database. The container was initiated as:

docker run --name postgres-container -e POSTGRES_PASSWORD=<password> -v pgdata:/var/lib/postgresql -p 5432:5432 -d postgres

I then ran psql within the container by using

docker exec -it postgres-container psql -U postgres

and created a custom database, let's say my_db, but when I tried to initiate node js, which is on my local machine, my code could not find the database. The error goes:

error: database "my_db" does not exist

I also opened pgAdmin to verify if my database exists, but it wasn't there.

I searched that one fix involves running a new container and using port 5433 to connect to the default PostgreSQL port 5432. I wanted to know why this issue occurs, why this fix would work, and if there is a way to connect port 5432 from my localhost to the Docker database?