microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
175 stars 26 forks source link

Docker Desktop Licence Issue #313

Open PatGet opened 2 years ago

PatGet commented 2 years ago

Hi there, i guess this is the wrong place so please feel free to point me in/to the right direction/person/link and close this issue.

I would like to find find out what are your plans and/or what are my options regarding docker support in Visual Studio. Docker Desktop will not be free for us with grace period ending January 31st. I´m not that deep into the Tooling and i don´t want to underestimate the complexity here but isn´t Docker Desktop "just a Proxy" to the Deamon running in WSL2? Would it be possible to replace it with something else and not rely on a additional paid UI Tool? I´m not really using the Desktop UI so i just need it to be able to press F5 in VS. As we have already expensive VS Pro and Enterprise Scubscriptions (Add resharper on top) in place I´m having hard times explaining to our management why we need additional licences just for the developer experience of running a container locally.

I could imagine the following Options: 1: Docker Desktop Licence is part of VS Subscription 2: The Docker Tools work with the Docker CLI out of the Box without needing Docker Desktop 3: You describe what VS is locking for so someone (either yourself, other Tools like Rancher Desktop or the Community) could create a replacement.

best regards, Patrick

BigMorty commented 2 years ago

Hello @PatGet, I am the PM owner of our container tools in VS, VS Code, and VS for Mac. I don't have specific answers to your questions at this time, but I wanted to reply and let you know this is a topic my team has been discussing.

Addressing your question "isn´t Docker Desktop "just a Proxy" to the Deamon running in WSL2", take a look at this blog post from the Docker team - https://www.docker.com/blog/looking-for-a-docker-alternative-consider-this/

jsheetzati commented 2 years ago

Also interested in options to avoid Docker Desktop licensing. Can we make VS2022 container tools work with Docker or Podman running in WSL2? Rather than needing Docker Desktop installed on Windows

MDendura commented 2 years ago

Assuming that the VS Container Tools are using the Docker CLI internally, I think a configuration option to allow us to switch between running docker --args.... and podman --args... would be pretty useful here.

That way if we don't want to install Docker Desktop and pay the license fee we could switch to Podman instead.

adrilmorell commented 2 years ago

Also using Docker Container tools for VS and now that I need to swith to docker in WSL2 without Docker Desktop I find out that it is not supported. I guess the problem was with the docker-compose not being part of the cli but this is not longer the case from version 20.10.3 https://docs.docker.com/engine/release-notes/#201013. Is there any plans to switch into docker compose now that docker server supports it?

dbreshears commented 2 years ago

Hi @adrianleonmorell, there are no plans to switch into docker compose as suggested. We do still require Docker Desktop currently with the VS tooling as it is the most straightforward acquisition experience for Docker on Windows and helps us with other items such as volume mounts for containers backed by WSL2, etc.. However, we are investigating enabling alternative container options such as you describe but too early to give a timeframe

MPCoreDeveloper commented 1 year ago

I had expected this to be solved by now 😕 , but I guess I had almost locked myself in to a Docker subscription.

I have to stop using vs 2022 to build containers and move to VSCode on Linux for that?

BigMorty commented 1 year ago

The latest version of VS 2022/.NET can build containers without a Dockerfile and without docker installed! This works great when you just want to build a Docker image and then deploy it to the cloud. In fact, this is built into the publish flow for Azure Container Apps.

https://devblogs.microsoft.com/dotnet/announcing-builtin-container-support-for-the-dotnet-sdk/

MPCoreDeveloper commented 1 year ago

I have the latest version of Visual studio Preview and Visual Studio 2022 the current version , however when I do not have Docker on my system I loose the options of creating a Docker container from the GUI of the IDE .

But okay with this link i could create myself some scripts and see if this will work , my use case is creating a container pushing it to a Azure repo and then running it on a on-premises K8S system.

But I miss that just setting a click on a project and having everything from the VS 2022 Enterprise IDE as I did in the past on our companies dev system .

BigMorty commented 1 year ago

Here is how you can do this in the VS 2022 UI. This is a new .NET 6.0 web app I just created WITHOUT Docker support added. Right click on the project and select Publish image

Select Docker Container Registry image

Select Azure Container Registry image

Select an existing Registry or create a new one image

Select .NET SDK since you don't have Docker Desktop installed OR a Dockerfile (pretty cool, huh!) image

Then click Publish and VS/.NET will build the image and push it to your Azure Container Registry (ACR) image

TaDa!!! image

zane-woodard-drc commented 1 year ago

The latest version of VS 2022/.NET can build containers without a Dockerfile and without docker installed! This works great when you just want to build a Docker image and then deploy it to the cloud. In fact, this is built into the publish flow for Azure Container Apps.

https://devblogs.microsoft.com/dotnet/announcing-builtin-container-support-for-the-dotnet-sdk/

This seems to be missing a big use case for VS Container tools, which is building, running, and debugging containers during the development process. Creating a docker image was never a big problem, building & debugging the the app in the container is. VS Container tools is great for this, I'm using a docker-compose.yml to build & run my primary app and also startup several dependencies (SQL Server, Cosmos Emulator, some other microservices) with 1 click in the IDE.

However, for some confusing reason, VS Container tools has a dependency on Docker Desktop rather than the daemon -- which makes it impossible to avoid the Docker Desktop licensing problem and do things like switch to Podman.

Furthermore, how many developers are actually publishing docker images straight from Visual Studio? I'd wager not very many. Maybe 10 years ago that would make sense, but with tools like GitHub Action of ADO Pipelines it's rare for devs to be doing this directly in a VS GUI.

BigMorty commented 1 year ago

I was just making sure you new a way in VS to build and publish, agree CI/CD is the robust way to go.

Regarding VS requiring Docker Desktop, I will defer to @dbreshears and the tooling team to see if they are looking to change that.

LeaFrock commented 1 year ago

This problem blocks some avenues of learning/working. For example, eShopOnDapr uses docker compose as default. Since there's only podman in my environment, VS always outputs the following errors.

image

podman is compatible (and better in some degree) but not be supported as a first-class citizen, while docker is the only tool-SDK winner. It looks a bit weird.

matdmul commented 10 months ago

Hey @BigMorty @dbreshears I do appreciate all the work that your team are putting into this. Any update? Similar to @LeaFrock, when attempting to run a docker-compose service in Visual Studio 2022, I see:

Severity    Code    Description Project File    Line    Suppression State
Error   DT1001  Unable to run 'docker-compose'. Verify that Docker Desktop is installed and running locally. For troubleshooting, please refer to https://aka.ms/DockerToolsTroubleshooting.
If the error persists, try restarting Docker Desktop.   docker-compose  C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets    425 

(Apologies if I've picked out the wrong thread for my issue, please redirect me to create this where it needs to live)

On my system I have docker, docker-compose and podman installed. All are able to run the docker-compose services.

I was hoping there might be some way to point Microsoft.Docker.Sdk to where docker-compose IS installed to avoid this issue, rather than insisting I have Docker Desktop available? What joy can I hope for here? 🤞

zs-dima commented 9 months ago

+1

stevenmolencsat commented 4 months ago

+1. The ability to use podman or rancher desktop for those of us well into our container experience and tired of the performance problems and licensing problems that come with docker desktop would be optimal. Please and thank you.

NCarlsonMSFT commented 3 months ago

@stevenmolencsat While Docker Desktop remains our supported and tested container runtime, we don't block alternatives. I just did a quick test on 17.10 using Podman Desktop and was able to debug in a container from VS.

AdrianoAE commented 3 months ago

@stevenmolencsat While Docker Desktop remains our supported and tested container runtime, we don't block alternatives. I just did a quick test on 17.10 using Podman Desktop and was able to debug in a container from VS.

May you share the setup, because as already mentioned VS refuses to even attempt to start the containers because Docker Desktop is not installed, we tried all the workarounds we could find and nothing worked

e-master commented 3 months ago

fwiw, i switched from Podman to Rancher Desktop and everything works like a charm in VS now. Sure, the UI is not as nice as in podman, but that wasn't a deal breaker for me.

NCarlsonMSFT commented 3 months ago

@AdrianoAE, sorry I did skip a step. I had previously installed the docker cli (not the Engine or Docker Desktop) and added it to %Path%

codekoenig commented 1 week ago

@NCarlsonMSFT I'm able to use Podman with Visual Studio for docker build, but there is an issue with docker compose: Visual Studio looks for the following file during a docker compose task: \AppData\Roaming\Docker\settings.json - this file, I found out, is placed there by installing Docker Desktop, but ofc this does not happen when installing Podman.

Is there a specific reason for the need of this file or is there any recommended workaround?

NCarlsonMSFT commented 2 days ago

@codekoenig sorry for the delay. The machine I'd been using to test podman went sideways and required re-imaging. Testing on my new clean machine I was able to F5 a compose project without issue.

Looking through our code, the only place we would check for that file is part of determining why launching failed. Can you provide any more context around what you are seeing?

FYI if you set VSCT_WslDaemon=1 we'll use WSL paths, and we won't run any Docker Desktop specific checks. Podman Desktop supports both windows and WSL paths so this may be an interesting option for you.

codekoenig commented 1 day ago

@NCarlsonMSFT no delay noticed, thanks for getting back to me 😊

Ah, that explains a lot. In the meantime I placed a dummy file there to get over this step and yes, then I noticed that it would still fail as docker compose is missing - I erroneously thought the DockerCLI comes with it. There's no way to install it standalone (without Docker Desktop) on Windows it seems, but as you mention VSCT_WslDaemon=1 I guess what you did is installing compose in WSL?

NCarlsonMSFT commented 1 day ago

@codekoenig Getting docker-compose w/o Docker Desktop is documented here: https://docs.docker.com/compose/install/standalone/ You'll need to place the exe in %userprofile%\.docker\cli-plugins to be picked up by the docker CLI and activate docker compose support

codekoenig commented 1 day ago

Thanks very much @NCarlsonMSFT … I was hesitant on that as on the main page it was referring to that solution as unsupported:

Warning This install scenario is not recommended and is only supported for backward compatibility purposes.

But if it works for you, I can safely ignore this :)

Thanks to the team for making this possible, while Docker Desktop is great, the licensing is an issue especially when someone works with multiple companies. Most of all if all you really need is only the Visual Studio support.