Make sure you add the docker compose project file (.dcproj) into your solution, then you can run the whole application with one click with debug capabilities.
Setting it up with other development environments is another matter.
Bruce Ng's software development blog
An archive of solutions of programming problems I have faced in my career
Make sure you add the docker compose project file (.dcproj) into your solution, then you can run the whole application with one click with debug capabilities.
Setting it up with other development environments is another matter.
Some applications will use as much resources as possible, like Elasticsearch.
If you are running Docker for development and it uses up all your resources because of such application, you can configure the Docker backend to limit the amount of resources it can use.
If your Docker desktop is using WSL2 as backend, create a .wslconfig file in your user home folder in Windows with the following content
[wsl2]
memory=6GB
processors=4
Then, restart the WSL backend in Powershell
Restart-Service LxssManager
This will also restart Docker Desktop.
This will limit the resources Docker will use to only 6GB RAM and 4 core processors, leaving resources for your other applications and development tools.
I faced this issue, turned out when using docker cp to copy files to the container, the files were owned by root user and other users didn’t have read permission. This is because the files were copied from shared folder in Windows host to the linux VM.
Because only root can read, I couldn’t restore the DB using the copied file as the server cannot read the file.
Doing a chmod to add read permission before copying into the container solves the issue.
If you want to change a .NET Core project Docker target, for example from Windows to Linux, edit the project file and and change the value of property <DockerDefaultTargetOS>.
Change from Windows to Linux and vice versa.