How to debug in Docker, Windows 10, WSL 2 - visual-studio

When I try to run Debug F5 from VS 2019 using Docker
I see the following error
C:\Users\comet.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.9.10\build\Container.targets(198,5):
error CTC1001: Volume sharing is not enabled. On the Settings screen
in Docker Desktop, click Shared Drives, and select the drive(s)
containing your project files.
I have WSL2 and latest Docker Desktop, google says that sharing is already done
automatically so Desktop has no such Setting at all

I had the same problem with an older project. Creating a new project with docker support worked fine. The difference I found that the old project file had:
<OutputType>Exe</OutputType>
and the new project did not have that line, so I removed it. Also updated the targets:
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
This solved it for me

To start docker in WSL2 Ubuntu 20.04
first start wsl2
then run the command below to start docker daemon
sudo /etc/init.d/docker start

Related

Cant start docker containers from Docker Desktop in Mac

I've used docker desktop in Linux and Windows without problem, but i recently got a mac, and when i try to start a docker container i have setup via Docker Desktop, the docker container starts, but immediately just changes from "Running" to "exited" status.
This doesnt happen in the other environments i use docker, so any help would be appreciated.
I have been trying to find any kind of logs, but i cant find any.
im using mac os x 11.7.1 (Big Sur)
Docker desktop is the newest version 4.16.2
I have tried so far:
Reinstalling Docker Desktop
verified and ensured the permissions for access to docker are set correctly (access to files and folders)
I have setup my dockerhub account
Im using the latests versions of the php and python images available at docker hub.
Thank you.

Docker-Compose does not work on Windows Server 2022

I installed a new Windows Server 2022 and then followed the instructions to install Docker and Docker Compose on the Server. I also installed WSL and a Ubuntu20-04.
Then, I tried to run a docker-compose up command and it failed with the following error message.
Is there anyway for me to use Windows Server 2022 to run docker-compose?
A few steps here:
Set up your environment on that build, following the instructions here:
https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tab...
Given it's an Insider build, you may need this step as well:
https://hub.docker.com/_/microsoft-windows-servercore-insider
Then you can run a command like this to get your Windows Server 2022 Preview container images:
docker pull mcr.microsoft.com/windows/servercore/insider:10.0.20298.1
As a reference, these are Docker Hub Windows Server Base OS container image Insider release pages:
https://hub.docker.com/_/microsoft-windows-servercore-insider
https://hub.docker.com/_/microsoft-windows-nanoserver-insider

Is possible to uninstall docker desktop on MacOSX and keep docker docker-engine and VMs working?

I'm using docker for a while and when I installed it I didn't note if the command line and the GUI Docker desktop were installed as two separate things. So I want to uninstall only the docker desktop but keep the command line working on MACOSX 11.
Is that possible? How can I do that?

Where can I see log files for failed Docker Desktop Windows installation?

I am trying to install Docker Desktop for Windows on Windows 10.
The installer triggers the UAC prompt but then nothing else, silently dies.
Q: Where can I find the log files from Docker Desktop Installation (attempt)?
(Is there a command line argument I need to pass to Docker Desktop Installer.exe?)
Details:
Windows 10 Pro 64bit: 20H2, virtualization and hyper-v enabled
Docker Desktop: 3.3.3.64133
Context: I used to successfully run Docker Desktop, but an update failed and I could not install or uninstall it. I needed to see the installation log files.
Install logs are automatically generated by Docker Desktop Installer.exe, and can be found in:
%LocalAppData%\Docker\

Docker Desktop installation on windows 7 is not working

I've downloaded docker desktop from the website but was unable to open the installer.
My operating system is windows 7.
What are the steps required to install docker desktop on windows 7?
Docker Desktop is not supported on windows 7, you can use Docker toolbox instead.
Do following steps:
Install hyper-v
Install Docker Toolbox and try to follow link instructions
Run Docker Quickstart as admin.
After following above steps, you may not be able to run Docker Quickstart Terminal properly. If so, follow below steps:
Go to window's Start.
type: Environment
click: Edit the system environment variables
Make sure you have VBOX_INSTALL_PATH (should point to VirtualBox installation folder. i.e. C:\Program Files\Oracle\VirtualBox)
Make sure you have VBOX_MSI_INSTALL_PATH (should point to VirtualBox installation folder. i.e. *C:\Program Files\Oracle\VirtualBox*)
Make sure you have VBOX_USER_HOME (e.g. C:\Users\Sara.VirtualBox)
Make sure you have DOCKER_TOOLBOX_INSTALL_PATH in your User variables (i.e. C:\Program Files\Docker Toolbox)
Restart your computer.
Try Running Kitematic. If its not working and you are receiving an error about "default" already existing or config.json missing, do the following:
close Docker Quickstart Terminal if open.
open task manager -> processes.
End process VBoxHeadless.exe
add an empty config.json file manually in %userprofile%.docker\machine\machines\default if config.json is missing.
Run in CMD: docker-machine rm -f default
Run in CMD: docker-machine create -d virtualbox --virtualbox-memory 2048 default
If the above CMD commands failed:
delete folder %userprofile%.docker\machine\machines\default manually
restart computer
run Docker Quickstart Terminal as admin
folder %userprofile%.docker\machine\machines\default should have been created properly at this point.
open kitematic. UI should be presented properly
Problem with "default" project
Failure on "default"
As far as I know, Docker desktop require Windows 10.
https://docs.docker.com/docker-for-windows/install/
System Requirements
Windows 10 64-bit: Pro, Enterprise, or Education (Build 15063 or later).
You will need Win10 pro to install Docker on PC, but otherwise you can still install Docker on PC by downloading Docker Toolbox for Win7,8,10. Link to download Docker Toolbox at:
https://www.softpedia.com /get/Programming/Other-Programming-Files/Docker-Toolbox.shtml

Resources