Docker in WSL vs. Docker Desktop on Host #3784
Replies: 4 comments 4 replies
-
Great conversation! The key benefits of installing docker inside the container are:
In general, the filesystem and networking issues.are the same between Docker Desktop and the docker-inside-WSL2 approach. |
Beta Was this translation helpful? Give feedback.
-
Okay, thank you for clarifying! I can understand that stability is an important point. I didn't experience any problems with docker desktop in the last year. But i only use it for basic tasks like running ddev, or testing gitlab or elastic in a container. I think it is important to consider your target group. Linux Fanboys Mac Users Windows Users I apologize if anyone feels offended by this stigma. Lets compare the advantages and disadvantages of both solutions:
In my Opinion using a docker installation via command line would fit the profile of a Linux and maybe aMac user but not that of a windows user. So I still think any docker installation should be supported by ddev and none should be suggested. |
Beta Was this translation helpful? Give feedback.
-
@rfay I understand your points, nevertheless I would like to write some concept paper suggesting an alternative installation approach for dddev in Windows WSL, if you allow me to. It will include Docker Desktop as a mainstay. I know about the licensing problems for larger companies, and I can't provide a solution for that, but as I already mentioned, companies that want to use ddev and have high enough revenue to need to pay for docker desktop will most likely just pay for a license, the pricing is quite fair. |
Beta Was this translation helpful? Give feedback.
-
@rfay, here you can find my concept on how to setup DDEV inside WSL based on the interop feature. https://gist.github.com/nico-loeber/6d6e8261827c5e4efa4ccf5b5cd04140 Feedback is welcome. |
Beta Was this translation helpful? Give feedback.
-
Hello,
as @rfay already noted a few times, ddev might change the docs to suggest installing docker inside WSL instead of using Docker Desktop on the host. I would like to understand and discuss the reasons for this.
The idea of WSL in Windows is a fusion of the advantages of both operation systems and as much interoperability as possible.
This starts with the Windows Terminal that allows you to easily switch between a windows and a linux terminal, the possibility to access both file systems from each other, as well as many other features that allow interoperability between both systems.
Software like VSCode, PHPStorm adapt this idea and allow you to benefit from WSL features even they run in windows.
Docker Desktop does the same as it allows you to run your containers in the WSL Backend while you can control them from your windows host or any wsl distribution. It also provides a GUI to manage your images, volumes and provides even a dockerhub integration.
Installing Docker directly in Linux might cause some some issues in my opinion. You can not manage your images from your windows environment and you do not have a GUI. Also windows won't be aware about the installed docker and there won't be any entries in the windows hosts file. The hosts file of your WSL distributions will automatically be overwriten by your windows one, if you do not disable this behavior.
This might make networking and accessing your containers more difficult.
Also you need to reinstall your WSL from time to time to be able to use new features or for an easy dist upgrade. In this case I just backup my ssh config and I push my latest project changes, the I simply remove the distribution and install the new version. I don't want to have any software I have to configure installed in my WSL. This might be a personal flavor of course.
I do see some benefits in using docker directly inside wsl. You do have the "original" docker and you do not need to care about licenses. Also I prefer administrating linux environment over windows. Installing and configuring stuff is more simple. But this shouldn't be a reason, since you already made the decission to prefer windows if you come to the question we just discuss.
For sure there are more benefits I'm not thinking of, so please tell me. :)
I would suggest that ddev should be independent from either docker installation method. The documentation should just state that docker needs to be available and should reference related external documentation.
There shouldn't be a "default" way, even though I personally prefer docker desktop as it fits better the idea of WSL, a seamless integration that connect the best of both worlds.
Beta Was this translation helpful? Give feedback.
All reactions