Production environment means Windows server, not Windows 10 or Windows 11. Docker Desktop was not designed to run as a server as it is for development. I’m rooting for everyone who tries to do it on Windows 10/11, but it requires more Windows knowledge than I have. And even if someone solves it, who knows how long it will work when Docker Desktop (or Windows) is updated.
For Linux containers, production means a Linux server. Either physical or virtual.
As I wrote before, it only works if you disable WSL 2 in Docker Desktop. Have you already tried that?
But the problem of not being able to start the graphical user interface remains, because Docker Desktop is already running in the background.
Docker Desktop is not made for this. On the one hand, it is a graphical user interface that should only be started after the windows login and on the other hand, it is only intended for developers. And under no circumstances is this solution suitable for permanently stable production systems. Just like @rimelek has already written
You may want to create a user specifically to run docker. User “Docker” in Windows for example. The installation shouldn’t be tied to one specific Windows user or it won’t boot unless that particular user logs in. Install docker under that Docker user. Create a task in the scheduler so that it allows the docker executable to run at start up regardless of whether someone logs in. You also may need to edit the sudoers file so that docker runs, doesn’t hang at the password prompt and the image that it’s using will need to be given “–restart=unless-stopped” options. So, Windows–>task scheduler—>runs ubuntu.exe(as an example)—>sudo service docker start(Docker can be added to the sudoers file, so that this runs without a password needed. It has to be added to the group,file and has to sit in the file in the proper location.)—>docker start “whateverimage.” An example of why you would want this done is if power is lost, restored and you had an image running that people access externally. It wouldn’t need any human intervention.
I know this response is months late, but from a completely non-development point of view, Docker Desktop comes highly recommended as one of the sleekest and most user friendly container freeware to self-hosting enthusiasts. I think the number of people like me who have only one machine for work, games, and server self-hosting is probably staggering, and a tool like Docker Desktop that can run server tools alongside our other daily driver programs is very appealing.
The obvious drawbacks are what they are. Windows doesn’t really want us to play in the sandbox and works very hard to lock down tools with UAC and wincred (in ways not just limiting for security reasons). As a relevant example, a mandatory restart by Win Update shuts down Docker and all containers. This is what we seek to bypass, the why is secondary.
What I am saying is, you may be marketing and developing for one group of people, but you have an entire sector of enthusiasts who are interested in your product and think it is oh so close to perfect for their use cases. I know that’s why I’m here, months later, scrolling for an answer to this question.
I don’t think it would ever be late Thank you for sharing your view!
Just to be sure, you know it, we are not Docker Inc. This is a community forum. Docker staff members come sometimes, but usually we are just community members.
Can you give us a link where you saw recommending Docker Desktop for “self-hosting enthusiasts”? I’m asking because Docker Desktop is for development so it is indeed recommended By Docker Inc for development, but as far a I know, not for self-hosting. You can temporarily access ports from a mobile phone or other machines while developing, but for anything else, another kind of virtual machine hosting Docker containers would be a better way. And if a VM can be started automatically, then problem solved You could even get a GUI if you install Portainer in that VM.
Feel free to share more thoughts if you disagree with anything, or more details to help me understand the use cases better. Note that I’m not saying that allowig Docker Desktop to start automatically would be a bad feature. All I’m saying is that I would try different approaches anyway.
Can you give us a link where you saw recommending Docker Desktop for “self-hosting enthusiasts”?
The recommendations I find online aren’t from official sources but from various Reddit posts on r/selfhosting, misc other forums, and even Nextcloud and other container software forums. It is really common to see “if you are doing this on a Windows machine, use Docker Desktop!” It is just so plug-and-play, perfect for noobs. No need to learn to use a VM, no need for additional hardware or server software. It is all just right there.
I am clearly no expert. I have been working off and on to self-host for a few years now, but only got started again a few weeks ago. It just seems like Docker Desktop scratches a very specific itch for those wanting to figure out small scale self-hosting. And even though it is outside of the intended design, it seems to do it well enough that people have already been using it for a few years.
Feel free to share more thoughts if you disagree with anything
I definitely don’t disagree. This request stems from a clear tangent from the intended purpose of Docker Desktop (using it as a production tool in Windows). But it is just the only good tool for that purpose. Companies build their products for Docker, so it makes sense that there would be a crowd of people wanting a Docker production tool baked into a Windows app that they can run parallel to Skyrim and Excel.
As for the auto-start after reset feature, this just comes with the territory. Having a self hosted password manager is only fun until your computer restarts while you are away. Heaven forbid you needed that self hosted PowerPoint presentation while you were on a work trip. (Windows update sucks.) My polite nudge to the developers would be to say “I know what your software is built for, but maybe throw these other guys a bone or two?”
And as for me, I like your recommendation of switching to a VM. I’ll do just that. Definitely not the easy solution I came looking for, but it’s a good one, thank you.
I’m surprised I haven’t shared it in this topic yet, but new features can be recommended in the roadmap:
I searched for “start automatically” and found this issue
Anyone who want an autostart feature without logging in on Windows can join the conversation there. Here on the forum we can discuss features, recommend alternatives but can implement features in an application which is not open source.