docker: Error response from daemon: invalid volume specification: '/var/run/docker.sock:/var/run/docker.sock' - Windows 10 - docker-daemon

I want to install Appwrite for Windows 10, I copied and pasted the CMD command in their installation docs but I keep getting:
docker: Error response from daemon: invalid volume specification:
'/var/run/docker.sock:/var/run/docker.sock'
PS: I have docker installed.
I tried to run the CMD as a administrator and tried to use download it from PowerShell, but I have the same issue.

Please make sure you have WSL 2 installed and Docker is configured to use WSL 2 based engine.
Additional references:
Docker docs on WSL: https://docs.docker.com/desktop/windows/wsl/
GitHub Issue: https://github.com/appwrite/appwrite/issues/5026#issuecomment-1408162967

Related

Lens (K8s client) give error: exec: executable oci not found

I spent several hours looking at this Lens error for K8s. I installed Python, OCI-CLI for Windows 10 (I downloaded oci-cli offline installation, and run python install.py) and configured cluster access. Using CMD works ok:
kubectl command works fine, even get pods command works
But using Lens it gives me the error when connecting
Error getting Credentials: exec: executable oci not found
What am I missing?
I finally found the solution, it was to download kubectl.exe
https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/windows/amd64/kubectl.exe
I put it in a folder on the disk, example c:\kubenetes
add that folder to the PATH environment variable.
Restart the PC. Without reboot it didn't work.

Podman isn't working in Remote Containers in Windows?

Any hints on why Remote - Containers isn't working with podman on Windows?
Installed podman v4.2.0 on Windows 11 via .msi package
Set remote.containers.dockerPath to podman in VS Code Settings
Run podman machine init
Run podman machine start
Open Remote Explorer in VS Code and be presented with the following:
Everything is working with podman — pull, run, images, etc, but Remote - Containers on VSCode doesn't recognize podman.
After running Remote-Containers Developer: Show All Logs... in VS Code:
[2022-08-21T12:55:15.916Z] Start: Run: podman version --format {{.Server.APIVersion}}
[2022-08-21T12:55:16.080Z] Stop (164 ms): Run: podman version --format {{.Server.APIVersion}}
[2022-08-21T12:55:16.080Z] Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: dial unix \\.\pipe\openssh-ssh-agent: connect: No connection could be made because the target machine actively refused it.
And podman system connection list in a terminal:
Name URI Identity Default
podman-machine-default ssh://user#localhost:62078/run/user/1000/podman/podman.sock C:\Users\Edmundo\.ssh\podman-machine-default true
podman-machine-default-root ssh://root#localhost:62078/run/podman/podman.sock C:\Users\Edmundo\.ssh\podman-machine-default false
Related Issues: #6957, #6747.
Please confirm you are running the latest build (prerelease)
v0.236.1.
(there are known issues on github with earlier release, fixed in this version)
in a WSL shell, i.e. for debugging try this
first - try to start podman podlib REST api (for socket, lifetime 5000 sec. - set to zero for "forever")
podman system service -t 5000 &
then symlink the podman.sock to the location vscode expects:
sudo ln -s /mnt/wslg/runtime-dir/podman/podman.sock /var/run/docker.sock
if none of that works, would you mind posting a dump:
podman info
HINT: check the podman info YAML output for host | remoteSocket | path & make sure it matches the path /mnt/wslg/runtime-dir/podman/podman.sock above.
The bug being tracked on GitHub. One step you should also do is enable Run in WSL in VS Code Development Container extension settings. Then it will run the podman commands in the podman-machine-default wsl instance.

"Error: couldn't add user" in MongoDB docker stack using a secrets file on Windows

While trying to run a MongoDB docker instance with authorization managed by docker-secrets (with files), inspired by this blog post, I kept running into the following error:
2020-07-24T16:25:26.656+0000 E QUERY [js] uncaught exception: Error: couldn't add user: Error preflighting normalization: U_STRINGPREP_PROHIBITED_ERROR :
Setup
Windows machine running docker with a WSL2 backend.
latest mongo image from docker hub (version 4.2.8)
docker secrets to manage the authentication credentials to the MongoDB database
my composer file:
# docker-compose.yml
version: '3.5'
services:
my_db:
image: mongo
command: --auth
environment:
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongodb_root_password
MONGO_INITDB_ROOT_USERNAME_FILE: /run/secrets/mongodb_root_username
secrets:
- mongodb_root_password
- mongodb_root_username
secrets:
mongodb_root_password:
- file: mongodb/.mongodb_root_password
mongodb_root_username:
- file: mongodb/.mongodb_root_username
shell command to deploy docker stack
$ docker stack deploy --compose-file=docker-compose.yml my_db_stack
Problem
Unfortunately, the container kept dying. In the logs, I was able to find the error mentioned above.
It turns out that the problem was caused by Windows-style line endings in the mongodb/.mongodb_root_password and mongodb/.mongodb_root_username files. Those files were created on the Windows host, and then (I assume) were blindly copied to the container.
Solution
Using notepad++ I switched the line endings to Unix-style, which solved the problem.
To switch the line endings, I right-clicked the highlighted portion of the bottom bar in the image below, on Notepad++.

How to run Mongo container on Windows Server 1809

I'm trying to run a mongodb container on Windows Server 1809 but am getting the following error:
docker run --name mongodb --restart unless-stopped -d -p 27017:27017 mymongo
docker: Error response from daemon: hcsshim::CreateComputeSystem bf9bf4086726d00cbcaff1f082e6b1db12bd803f3ba2c2ca7c0db1e5d75aa316: The container operating system does not match the host operating system.
(extra info: {"SystemType":"Container","Name":"bf9bf4086726d00cbcaff1f082e6b1db12bd803f3ba2c2ca7c0db1e5d75aa316","Owner":"docker","VolumePath":"\\\\?\\Volume{452442a7-ac87-4117-8e82-b00a8d87b444}","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\bf9bf4086726d00cbcaff1f082e6b1db12bd803f3ba2c2ca7c0db1e5d75aa316","Layers":[{"ID":"fc52f55a-6f1e-5651-93c6-09c1fcaf7c9a","Path":"C:\\ProgramData\\docker\\windowsfilter\\c9035a2f08cd42f11c3c76895b03021b6d48266d0f86bd083c12fa5f86455e60"},{"ID":"ab78d923-9c41-55fc-92ec-a9330d5db560","Path":"C:\\ProgramData\\docker\\windowsfilter\\c01be26c30f8769641fe00741c162d71bb3305df4c71cbaf138ff2b901ec6b11"},{"ID":"026d80b8-19b3-5c4d-ae3d-35a54251fe3e","Path":"C:\\ProgramData\\docker\\windowsfilter\\def72c2b739b9f453610c44a8ed61e997306eaf34a2ecddd00198d0e7a002f97"},{"ID":"3f241ae1-ba2c-5fec-8d70-c2396e176817","Path":"C:\\ProgramData\\docker\\windowsfilter\\c7cedcded6a8aa587cef67edb4918bec61be7a3500892ea1e96ff7b2c3e13af2"},{"ID":"2efd8648-ea16-508d-8c5b-6a0ef3e6c84d","Path":"C:\\ProgramData\\docker\\windowsfilter\\60049935b45a47f9649619a2f5bcd87d9b9a909452c3bd0fbd1a6a7275bcb7b0"},{"ID":"eddd0e96-fd43-58c7-94fc-530892d35234","Path":"C:\\ProgramData\\docker\\windowsfilter\\80f9aa5efa51e2fa9b068a68b4b5dd5a4b10724cdeab62238dfe7d3f123767d1"},{"ID":"11f58e92-5415-5594-9910-9ff4f59731fb","Path":"C:\\ProgramData\\docker\\windowsfilter\\65f94285263b26ecb465ede59d13113b09e2e31891fc832e2700c00a5902c147"},{"ID":"cedb9cc2-9b4c-5175-bd37-f74b69253886","Path":"C:\\ProgramData\\docker\\windowsfilter\\95cb73e37cc8f93d5e63143c0d0de000cc1af77e498108babaf5ceebd09cebf0"},{"ID":"745ef0c5-ae72-5e25-b6bb-7208c533560e","Path":"C:\\ProgramData\\docker\\windowsfilter\\8984fb6ffe0575d27d836a764d64591ae175272a75260ee476507100618d3b78"},{"ID":"b0dcfd28-95d6-506d-bbcf-48e5f62ef97f","Path":"C:\\ProgramData\\docker\\windowsfilter\\e747665dffb09875cdeeb4438a422f2c6a3a83f3d30f1d77001e19a078ec3392"},{"ID":"f2fb9c30-cdca-513e-8409-c21af8fbfcaa","Path":"C:\\ProgramData\\docker\\windowsfilter\\f5641e2fbb273e21e654e8671af314de80a62f5a5074cfdb3a7784f296c6d171"},{"ID":"67e9a990-1ee4-597f-8e73-ee95b6f65d30","Path":"C:\\ProgramData\\docker\\windowsfilter\\e18aba5da9d71b86e113123d6635fcec544f1228b6c29e76b7027ed1d5b207d7"},{"ID":"741cd5e2-3dfe-5693-ba08-ac8fed4ae741","Path":"C:\\ProgramData\\docker\\windowsfilter\\6029438e12ce66ab4f7b48ca5f7aa10ff6d1b284602f2f6fa0ab2b56daa96796"}],"HostName":"bf9bf4086726","MappedDirectories":[{"HostPath":"C:\\ProgramData\\docker\\volumes\\e1898e25db59a589102c266339cc21243e62ba950a70a82f6b3fc31d693f1494\\_data","ContainerPath":"c:\\data\\configdb","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false},{"HostPath":"C:\\ProgramData\\docker\\volumes\\e42d0b5e649c60b87b7ff283b0db51f28d95cf1e9b2ef33ddb50344bf61358b7\\_data","ContainerPath":"c:\\data\\db","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false}],"HvPartition":false,"EndpointList":["A64F960D-CB2B-4452-8438-2A1E25105432"],"AllowUnqualifiedDNSQuery":true}).
I tried with both 4.2.1-windowsservercore-1803 and 4.2.1-windowsservercore-ltsc2016. I also tried using isolation=hyperv, but it gave me "Request is not supported". On another Windows Server, this one 2016, everything worked.
What can I do to run a mongo container on windows server 1809?
I got it working by copying the image for the MongoDB version I wanted on their github and changing the FROM line to
FROM mcr.microsoft.com/windows/servercore:1809

Minikube Start Error (Kubernetes) When Using hyperv Driver on Windows server 2016

I am trying to install Kubernetes on windows server 2016.
I tried to install minikube, and got some errors.
This is the tutorial that I followed:
https://www.assistanz.com/installing-minikube-on-windows-2016-server/
This is the command + error that I got:
PS C:\Windows\system32> minikube start –vm-driver=hyperv –hyperv-virtual-switch=Minikube
Starting local Kubernetes v1.10.0 cluster...
Starting VM... Downloading Minikube ISO
170.78 MB / 170.78 MB [============================================] 100.00% 0s
E1106 19:29:10.616564 11852 start.go:168] Error starting host: Error creating host: Error executing step: Running precreate checks.
: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path.
Retrying.
E1106 19:29:10.689675 11852 start.go:174] Error starting host: Error creating host: Error executing step: Running precreate checks.
: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path
================================================================================
An error has occurred. Would you like to opt in to sending anonymized crash
information to minikube to help prevent future errors?
To opt out of these messages, run the command:
minikube config set WantReportErrorPrompt false
================================================================================
Please enter your response [Y/n]:
Someone knows how to solve it?
I googled it, but no luck.
Thanks!
I was never able to get the config parameters to work with minikube start.
I was able to get past this error using the minikube config commands in PowerShell (should also work at a command prompt):
minikube config set vm-driver hyperv
minikube config set hyperv-virtual-switch ExternalSwitch
minikube config view
minikube delete
minikube start
For more information on the command run: minikube config -h
Looking at the documentation you have provided, I have noticed that the screenshot shows a slight difference to the one they've quote.
I have also found this command in another piece of documentation from kubernetes here, showing the same command as that from the screenshot.
I suggest you try the following command;
minikube start --vm-driver=hyperv --hyperv-virtual-switch=Minikube
It is true that OP has pasted the incorrect command, because there is - instead of --. I tried to pass this arguments to minikube and all you get is an instant error. So the issue must be somewhere else. I remember having similar issue and it got resolved after deleting the .kube and .minikube folders and trying to run it again.
After taking a closer look this tutorial is destined for installation of minikube inside of a Windows Server 2016 Virtual Machine, so you have to have a Nested Virtualization able hardware:
Prerequisites The Hyper-V host and guest must both be Windows Server
2016/Windows 10 Anniversary Update or later. VM configuration version
8.0 or greater. An Intel processor with VT-x and EPT technology -- nesting is currently Intel-only. There are some differences with
virtual networking for second-level virtual machines. See "Nested
Virtual Machine Networking".
So the main question is, is that true in your scenario? Are you trying to perform your steps on Windows Server Hyper-V virtual machine with nested virtualization feature?
If you confirm that I have technical possibilities to check it in that scenario.
Otherwise I recommend using the "traditional way" of running minikube in Windows, according for example to this tutorial.