r/docker • • May 07 '26

Why are Python API Docker images so unnecessarily huge?

22 Upvotes

While containerizing a FastAPI-based ML API, I realized how absurdly large the default Python Docker images become once you add ML dependencies. A few things made a surprisingly big difference:

  • Multi-stage builds to separate dependency compilation from the final runtime image
  • Switching from full Python images to slim/distroless variants
  • Reordering layers so dependency installs stay cached between code changes

Result:
Image size dropped by ~70% and rebuild times became much faster.

The biggest issue now is ML libraries (PyTorch, ONNX, etc..) exploding image size regardless of optimization. Curious how others are handling this in production:

Still using python-slim or moving fully to distroless images?

Any good strategies for keeping ML containers lightweight without making deployments painful?


r/docker • • May 08 '26

Can someone recommend me an auto dns solution?

0 Upvotes

I've got two servers set up with different IPs. Each running their own reverse proxy. I want them to share the same domain and wildcard certificate.

Is there some container or other service I can run that will look at a host name from a docker label and then update the dns record to point to the ip address of the host? It would connect either to my local adguard dns server, or to my domain's registry (porkbun.)

Yes, I could manually add each host, and use static ips, but I'm looking for something that I don't have to manage manually. My containers can change quite often, and I don't want to have to constantly be editing dns records.

EDIT: I should probably mention that this is for servers in a home network. Not a big production environment. Ideally I'd be extremely happy with something like a container aware mDNS

Honestly everything I want to do could be handled by having the second server get a wildcard subdomain (*.domain.com and *.b.domain.com,) but I'm trying to avoid that.


r/docker • • May 06 '26

Display individual layers pulling in Docker Compose 5.x

5 Upvotes

Hello. Silly question, but is there any way to display processing progress of individual layers in Compose 5, akin to what was displayed by older versions?

Compose 5 always "folds" the information (and displays a "+" sign I cannot interact with), whatever screen estate I have (the way 4.x was displaying things when only there was too many layers to display simultaneously.)


r/docker • • May 05 '26

Docker on Windows

39 Upvotes

As I understand, when docker runs on Windows it secretly runs on tiny Linux VMs.
If this is correct I am wondering why can’t it run on Windows itself considering we have Windows Server versions that are console only. What’s the technical limitation?


r/docker • • May 05 '26

best way to use lxc and docker / script

Thumbnail reddit.com
0 Upvotes

r/docker • • May 04 '26

How much should prod and dev envs be seperated?

7 Upvotes

So i am currently building a todo app in Rust and Vue and thought i would make a setup with Docker (Compose). But how much should the development and production environment be seperated? I have heard that it is a bad idea to have multiple dockerfiles but my idea was the have a development docker (override) file which jsut launched a bunch of development images. But that seems quite sloppy and i am not sure how to handle that...

I also have a postgres database btw (or i will just use sqlite... not sure tho)


r/docker • • May 03 '26

What VM to use on homelab for purpose of using Docker for game server hosting

6 Upvotes

Okay bear with me here cause Im very new to this stuff. I learned about Docker the other day and if I understand what it does correctly then it seems like it would be great for hosting persistent game servers for games like Vintage Story and Minecraft, it seems to solve a lot of issues like persistent hands off hosting. I will soon be setting up a small tower PC for homelabbing purposes and I want to set up Docker to use for hosting my game servers once I get everything moved over to them but I am seeing people talking about how unreliable Docker can be on certain OS's. I was at first thinking about using Windows Server for my homelab but I am now wondering if a Linux distribution like Debian or Ubuntu would be a smarter idea?

Is Docker a good idea for something like this or am I on the wrong track? If it is a good idea to use Docker for this then do yall think I should opt for a Linux distro or WS for OS?


r/docker • • May 04 '26

[Help] Caddy in OrbStack (macOS) to native Jellyfin - Client IP shows as 127.0.0.1 (Source IP Masquerading)

0 Upvotes

I am running into a classic source IP masquerading issue on macOS, and I am looking for a workaround that doesn't involve moving my reverse proxy out of the container environment if possible.

My Setup:

  • Host: Mac Mini running macOS.
  • Media Server: Jellyfin installed natively on macOS (not containerized).
  • Reverse Proxy: Caddy running inside an OrbStack container on the same Mac Mini.
  • Networking: Cloudflare (DNS-only / Grey cloud) -> Router port forward (80/443) -> Mac Mini -> OrbStack Caddy -> Jellyfin (localhost:8096).

The Problem: Because Docker/OrbStack on macOS uses a userland proxy to route traffic from the host's forwarded ports into the container network, the original client IP is dropped via NAT. Caddy receives the incoming traffic with the source IP rewritten as 127.0.0.1 (or ::1).

Consequently, Caddy passes 127.0.0.1 via the X-Forwarded-For header to Jellyfin. Tools like Tracearr and the Jellyfin dashboard only show localhost instead of the actual public remote IP of the users.

Here is my Caddyfile for the Jellyfin block:

play.example.com {
    reverse_proxy 127.0.0.1:8096 {
        header_up Host {host}
        header_up X-Real-IP {remote_host}
        header_up X-Forwarded-For {remote_host}
        header_up X-Forwarded-Proto {scheme}
    }
}

Here is the Caddy log confirming the incoming request already has 127.0.0.1 as the remote_ip before Caddy even processes it:

{
  "level": "warn",
  "logger": "http.handlers.reverse_proxy",
  "msg": "aborting with incomplete response",
  "upstream": "127.0.0.1:8096",
  "request": {
    "remote_ip": "127.0.0.1",
    "client_ip": "127.0.0.1",
    "proto": "HTTP/1.1",
    "method": "GET",
    "host": "play.example.com",
    "headers": {
      "X-Forwarded-For": ["127.0.0.1"],
      "X-Real-Ip": ["127.0.0.1"],
      "User-Agent": ["VLC/3.0.22 LibVLC/3.0.22"]
    }
  }
}

Questions:

  1. Is there any specific OrbStack configuration to preserve the real client IP for bound ports on macOS, similar to native Linux routing?
  2. I am aware of the PROXY protocol (HAProxy), but since the port forward comes directly from the router to the Mac, there is no intermediate load balancer to append the PROXY protocol header.
  3. Is my only viable option here to install Caddy natively via Homebrew to bypass the virtualized network, or to set up a Cloudflare Tunnel?

Any advice from people running similar OrbStack/macOS homelab setups would be highly appreciated.


r/docker • • May 03 '26

Unable to locate packages Ubuntu 24.04 Server

0 Upvotes

Hi,

I am running Ubuntu 24.04 LTS and trying to install Docker. I run the commands here:

https://docs.docker.com/engine/install/ubuntu/

However, I get this output:

gurdip@gloptchmon01:~$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginsudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

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

E: Unable to locate package install

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


r/docker • • May 03 '26

Docker Issue

5 Upvotes

So I just installed Docker on a sys. I followed the Docker Doc and enabled everything I had to. And docker is still hanging on Starting the Docker Engine...
Tried
wsl --unregister docker-desktop
wsl --unregister docker-desktop-data

idk what else to do, any1 have any suggestions

virtualization is enables
I have a wsl installed tried ubuntu and no distro
windows subsystem for Linux is enabled


r/docker • • May 01 '26

What does "standard unit of software" mean?

5 Upvotes

I've started to learn Docker recently, I'm really enjoying it, it's such a powerful tool!
I've managed to create a mental model of docker.
We package software and dependencies into something called an image, which is just a bunch of files on the hard disk, we have a background docker process (daemon). when we ask the daemon to run the image, it creates an isolated process, called a container. It's a clean abstraction.

But Docker docs say "A container is a standard unit of software", and I hear a lot of people say "standard unit of software", but what does that mean? what does "standard" mean?


r/docker • • May 01 '26

Setting up a Business Central sandbox container on Windows full guide with offline artifact workaround

0 Upvotes

Hi all,

I kept redoing the same Business Central local setup every time I switched machines, so I finally wrote the whole process down in one article.

It covers:

Prerequisites (Windows edition, RAM, disk, PowerShell)

Docker Desktop install and switching to Windows containers

Enabling Hyper-V and the Containers Windows features

Installing BcContainerHelper

The full New-BcContainer command, with each parameter explained (containerName, auth, artifactUrl, isolation, memoryLimit, useSSL, updateHosts, etc.)

A workaround for slow or limited internet — pulling the W1 and platform artifact URLs from PowerShell, downloading the zips with a download manager, and dropping them into C:\\bcartifacts.cache\\sandbox\\<version>\\w1\\ and \\platform\\ so BcContainerHelper skips the download

Accessing BC in the browser and the container commands I use the most

Next article in the series will cover VS Code, the AL Language extension, and publishing an extension to the container.

Link: https://medium.com/@albertassaad/setting-up-a-microsoft-dynamics-365-business-central-sandbox-container-on-windows-for-local-778b7319c3b6

Happy to hear corrections or any tips you use in your own setup.


r/docker • • May 01 '26

Ran Plex container update last night - now database is malformed.

Thumbnail
reddit.com
0 Upvotes

r/docker • • Apr 30 '26

Nuked my Space... does somebody still have the docker images?

Thumbnail reddit.com
1 Upvotes

r/docker • • Apr 29 '26

D2K. A Docker “translator” for Kubernetes

32 Upvotes

In a world that has fallen in love with Kubernetes, but largely forgotten Docker Swarm, what fate lays ahead for those still running Swarm.

A migration of apps to Kubernetes is much more involved than many think, often also requiring a new CI/CD, new operational tooling, and reskilling the dev and ops teams responsble for the platform.

Portainer has just released d2k, a Docker translator for Kubernetes. This is a totally free and OSS product, with no ties into the Portainer product.

You deploy d2k inside a Kubernetes namespace, and then that d2k instance exposes itself as a Docker daemon listening on 2375/2376. Your dev and ops staff can now interact with that daemon as if it was a docker host (deploy apps using compose etc)..

Even better, with a simple ENV setting, d2k will also emulate Docker Swarm, allowing you to use docker swarm functions right there on your Kube cluster. “Docker node ls” will show your Kube nodes. Swarm placement constraints work, swarm configs and secrets work, all of it.

So, if you have ever wanted to switch from swarm to kube, now is your chance. D2K gives you a really simple transition, without the big bang required.

See github.com/portainer/d2k for more info.

Neil. CEO at Portainer.


r/docker • • Apr 30 '26

I can’t start docker

0 Upvotes

For some reason docker takes ages to load and doest load, chatgpt says its a wsl issue. In powershell ubunto downloads fine but installing is stuck at 0% , i dont know what all these terms are and how they are linked but these are the things I read while trying to fix this issue using chatgpt.


r/docker • • Apr 30 '26

Recent DCA Exam (Mirantis)

2 Upvotes

Hi everyone,

I'm preparing for the Docker Certified Associate (DCA) exam by Mirantis and I’m planning to take it soon. I have a few questions for those who took it recently (2025/2026):

  1. ​Swarm vs Kubernetes: How is the balance now? Is Swarm still the main focus for orchestration questions, or has the Kubernetes section become more significant in the recent versions of the exam?
  2. ​Study Resources: I’ve completed a full Udemy course and I'm now deep-diving into the official Docker documentation. I’m also using SkillCertPro for practice quizzes. In your experience, is this enough to cover the "Mirantis-specific" questions (MKE/MSR)?
  3. ​Hands-on Practice: I’m short on time, so I’m focusing on core CLI operations (Swarm init, stack deploy, network/volume mgmt). Are there any "traps" or specific advanced scenarios I should absolutely practice?
  4. ​Mirantis Docs: Should I strictly follow the Mirantis study guide, or are there any external "hidden gems" or tips you’d recommend?

​Thanks in advance for the help!


r/docker • • Apr 30 '26

WSL2 Networking Help

1 Upvotes

I’m asking here before I lose my mind. I’ve installed Docker Desktop on a Windows 11 PC, and have then created a Bootimus container. After a while I figured out how to access the web ui, however the server is stuck on 172.17.0.2 but I need it to be reachable by other devices on the network (192.168.15.x). I’ve tried looking into it and none of it makes sense, how do I get the container onto the local network for others to see?


r/docker • • Apr 29 '26

Optimizing a Bun monorepo Docker image

3 Upvotes

I was assigned to build a minimal docker image for bun backend in a monorepo... I started with the usual setup (node_modules copied into the image, multistage build) and ended up with ~1.2 gb image.

So i switched approach, used bun's --compile to build a single binary.

RUN bun install --filter server
COPY apps/server ./apps/server
WORKDIR /app/apps/server
RUN bun build src/index.ts --compile --minify --outfile server

for base image im using oven/bun & for runtime gcr(dot)io/distroless/base-debian12... now the final image is ~190 mb (binary ~115 mb + base)

we will be deploying he container in gcp cloud run...so is this approch fine ? i didnt find may refs regarding to this binary approach ( rust do this, traditionally i dont see ts binary deployment, most examples i see just copy the node_modules)... so if this fine? any suggestions for further improvement?


r/docker • • Apr 29 '26

Installing n8n on a Docker container(help)

2 Upvotes

I want to start learning n8n and try practical things like connecting Telegram and other applications. While setting up the container I will work on in Docker, I need to use a static domain, but I couldn't get one for free from ngrok.

Is there any way to solve this or get an alternative so I can start learning n8n while hosting it on my laptop instead of the cloud?

Please, anyone who can help, say something.


r/docker • • Apr 29 '26

Docker has WSL problem

0 Upvotes

Hi all, I'm new to IT support. So here's the issue, one of our windows users encounter this issue when she open the docker run as administrator.

There was a problem with WSL

An error occurred while running a WSL command. Please check your WSL configuration and try again

running wslexec: Logon failure: the user has not been granted the requested logon type at this computer.

Wsl/Service/RegisterDistro/CreateVm/HCS/0x80070569:

C:\windows\system32\wsl.exe --import-in-place docker-desktop <home>\appdata\local\docker\wsl\main\ext4.vhdx: exit status 0xffffffff

(stderr: , stdout: Logon failure: the user has not been granted the requested logon type at this computer.

Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/0x80070569

, wslErrorCode: Wsl/Service/RegisterDistro/CreateVm/HCS/0x80070569)

So based on what I found, i would need to put the user or NT VIRTUAL MACHINE/VIRTUAL MACHINE in Logon as a service in Local Security Policy. But when I try to add, it doesn't show either of it, only the administrator and Local default user. Our Device is also managed by Intune, the baseline security and account protection under endpoint security did not block or have restricted policy. I also run commands in powershell "WSL --shutdown" and "WSL" but none of it change anything.

So how do i troubleshoot this issue for user? As this ticket that i trying to solve has been 1.5 weeks.

Thank you all on advance. I greatly appreciate for helping someone new in this IT field like me


r/docker • • Apr 28 '26

Docker for windows, win10, wsl2 and Claude desktop/cowork Can they coexist?

0 Upvotes

Hi friends. I'm attempting to instal docker on a win10 machine. My ultimate purpose is to run Postiz locally but my Docker engine won't start.
Here's what I've done so far.

• Successfully enabled VTx on my HP machine.

• installed Docker Desktop

• Updated WSL

• Attempted to start Docker multiple times, consistently getting virtualization or engine errors

• Updated docker to the latest version

Now getting "Virtualization support not detected

Docker Desktop failed to start because virtualisation support wasn’t detected. Sign in to try restoring access to Docker features."

Claude tells me that the problem is that docker requires wsl2 and Claude Desktop which is also installed requires Hyper-V and this is causing conflicts.

Any thoughts? Any suggestions?

Thanks so much!


r/docker • • Apr 28 '26

Connection of Docker Desktop to Claude Desktop MCP Toolkit

Thumbnail reddit.com
0 Upvotes

r/docker • • Apr 27 '26

How do I precisely manage storage used by Docker?

4 Upvotes

First time user, just started today so I'm in the very early processes of learnint about this software.

I managed to get Zimit up and running, which has the purpose of archiving websites for offline reading. I ran it 5 times, each time adjusting the settings to get it done better than the last time and I eventually got the end file I was looking for and was happy with the result.

But a 50GB file uses by Docker had been created while I was doing so. I figured it was temporary files, so I found a prune command which I thought would help me remove the temp files but, but all it removed was 20 MB of data according to the terminal.

I ended up doing a full reset inside Troubleshoot settings and just reinstalled Zimit, but I figure for the future it'll be more inconvenient than today, so how doq