visual-studio-code : failed to connect. is docker installed? - docker

my environment :
MacOS M1 chip
VSCode version 1.66.2 arm64
local installed docker version : 20.10.22
I have situations that docker is not working in VSCode.
I already installed docker in local. But when I'm trying to connect docker in VSCode, repeatedly asking install docker extensions. (but I do have docker already ). and if I do reinstall with following the VSCode, the docker version was broken (changed to intel chip docker).
Does anybody know what's wrong?

Docker Extensions for VS Code have nothing to do with the Docker engine itself. They are like an additional layer of tools and commands over the installed Docker. E.g. they provide IntelliSense for editing Docker-related files, you can run Docker commands from F1 drop-down, etc. But you should be able to do all the required tasks even without Docker Extensions, e.g. from the Terminal in VS Code, but for this the path to Docker CLI (command line interface) should be added to PATH environment variable.
If you are getting failed to connect error then maybe Docker engine is not running. Please refer to https://docs.docker.com/desktop/install/mac-install/ and https://docs.docker.com/desktop/troubleshoot/overview/ about how to check if the engine is running and how to troubleshoot the issues.
If that doesn't help, please provide some specific error and steps, which led to it, then we'll try to find out.

Related

quorum-dev-quickstart when running in WSL2 got error message: incompatible with Windows

I am following the tutorial on the hyperledger besu Developer Quickstart and I tried running npx quorum-dev-quickstart but always received this error even though I am already using WSL2 with docker installed:
Unfortunately this tool is not compatible with Windows at the moment.
We recommend running it under Windows Subsystem For Linux 2 with Docker Desktop.
Same thing happens when using the Git Bash. Can anyone let me know what I should do differently? Thank you!!
I tried Git Bash, WSL2, PowerShell and none of them worked.

ERROR: Couldn't connect to Docker daemon at http://0.0.0.0:2375 - is it running?

I am watching a course on Hyperledger Composer development online. I installed all the required prerequisites, docker, docker-compose, nodejs, golang. After cloning the fabric-samples repository from github. There is a file called byfn.sh inside a folder called first-network. On running the command ./byfn.sh up, it's giving the following error:
If, someone has experience working on it, please help. Any help would be appreciated. Thank you.
I think the first thing you should do is stop looking at or trying to use Hyperledger Composer. It is end of life now and some of it's components will have problems even if you install the exact required versions (for example the rest server fails to launch now on node 8 but changing to a newer version of node may break other parts of Composer).
As you had planned to use it with hyperledger fabric I would suggest that you just invest your time in Hyperledger fabric, see https://hyperledger-fabric.readthedocs.io/en/latest/
Regarding your problem with docker, I suspect you tried to install docker through the apt command in your wsl window ? I'm guessing that you are using WSL2, but if you are using WSL1 then docker will never work in a WSL1 environment. If it was WSL2 then the docker daemon doesn't automatically start in that environment you need to start it yourself first. I think the command is service docker start. The important thing here is to make sure you are using WSL2 and not WSL1 (see hyperledger fabric link later which provides guidance on making sure you are using WSL2).
An alternative to installing docker into WSL2 directly would be to install Docker Desktop for Windows and follow the hyperledger fabric instructions here https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#wsl2

Docker for windows missing quick start terminal

I installed the latest version of Docker for windows in my windows 10 machine. It seems the new Docker Desktop toolbox doesn't contain the Quick start terminal. Every documentation says to check the quick start terminal option at the time of installation. I dont see any option to check that option with the latest Docker toolbox.
Is there any way we could install Quick start terminal for windows.
Or are there any other alternate to the QS terminal. My objective is to build, tag and push / pull docker images to a gitlab registry. Powershell, command promt doesn't work because its a windows machine.
with the new Docker-for-desktop versions there's no need for the added toolbox as marked here
Legacy desktop solution. Docker Toolbox is for older Mac and Windows
systems that do not meet the requirements of Docker for Mac and
Docker for Windows. We recommend updating to the newer applications,
if possible.
You can just open any typical terminal in your OS of choice and use the docker cli if you can't remember the exact usage try docker --help 😉

Remote-Containers Extension of VS Code not able to execute docker commands

Setup:
Ubuntu 20.04 distro running inside WSL2 (5.4.72-microsoft-standard-WSL2)
VS Code version 1.55.2 installed in Windows
Docker version 19.03.8, build afacb8b7f0 installed in WSL2
docker-compose version 1.29.0, build 07737305 installed in WSL2
Remote-Containers Extension for VS Code v0.166.1 installed locally (I could not find an option to explicitly install this inside WSL2, but I am not sure if this even matters, see below)
Original error:
When I open the command palette and enter Remote-Containers: Rebuild and Reopen in Container, I get the error `The 'docker' command was not found. Make sure Docker is installed' in a pop up window.
What I tried:
Attempt 1
First, I thought that the Remote-Containers extension wants to execute the docker commands inside windows and not WSL2. Since I don't have Docker Desktop installed on Windows, it is impossible to execute docker commands in Windows. So I tried downloading a specific version of the the Remote-Containers extension file from the marketplace v0.165.0 I believe, copying it into the VS extension folder inside WSL2 /home/kevinsuedmersen/.vscode-server/extensions and installing it manually from the VS Code Extension panel. However, this also installed the Remote-Containers extension locally, so probably on Windows. I am not sure if locally means that this extension is available globally, but nevertheless, I am still getting the error that the docker command is not found as explained above.
Attempt 2
I notice that when I open a PowerShell on Windows, I can use the docker daemon inside WSL2 by prepending wsl to all docker commands, e.g. wsl docker run hello-world. So, I went to the VS Code and in settings (Settings > Remote > Containers > Docker Path), I changed the docker path from docker to wsl docker, but then, I got this error Docker Desktop WSL 2 backend required. This is even the case on another laptop, where I actually have Docker Desktop installed and the WSL2 backend enabled.
Attempt 3
I tried changing the docker path in VS code to the full path of the docker socket in WSL2 /var/run/docker.sock, but then I got the error Current user does not have permission to run 'docker'. Try adding the user to the 'docker' group. My current user kevinsuedmersen is already member of the docker group.
Any advice or directions are greatly appreciated.
Answer was given on the GitHub Repo of the VS-Remote-Container Extension here: https://github.com/microsoft/vscode-remote-release/issues/4914

Docker for mac on machine that previously had boot2docker installed complains about TLS configuration

I took an older macbook back in use. It previously had boot2docker installed when the native docker for mac didn't exist yet. That might be the root cause of my issue.
I've installed the new docker for mac but when I run docker-compose I've got the following error:
docker.errors.TLSParameterError: Path to a certificate and key files must be provided through the client_config param. TLS configurations should map the Docker CLI client configurations. See https://docs.docker.com/engine/articles/https/ for API details.
I don't want to install a docker machine with virtual box or anything. I just want to run it natively like a fresh docker for mac installation. All the solutions I've found so far require me to use a docker-machine.
Fixed it by unsetting all legacy docker machine environment variables so that it uses the correct docker commands
unset ${!DOCKER_*}
I've found the solution on the docker troubleshooting page over here.

Resources