Solve the permission problem of docker.socket of vscode docker plug-in

Time:2021-10-22

在这里插入图片描述

Solution: kill all. Vscode related processes in the system (remote server if remote SSH is used)
These processes are.vscodeFolder, so you can search directly.vscodeKill them and restart vscode to solve the problem.

在这里插入图片描述

Knowledge point extension:

Docker plug-in in vscode cannot connect

Failed to connect. Is docker running

Error: connect EACCES /var/run/docker.sock

Cause analysis

The reason is that docker uses UNIX socket for communication, but UNIX socket belongs to root user, but ordinary users need to use sudo to enable root permission, but ordinary operations do not have root permission.

Solution

Log in as root, but the security is not guaranteed

Add ordinary users to docker group

Sudo groupadd docker # add docker user group
Sudo gpasswd - a $user docker # adds the current user to the docker user group
Newgrp docker # update docker user group

Log in to vscode again after adding. After the user reconnects, the docker plug-in will run normally.

test

You can run the docker PS command. If there is normal output, it is normal.

The above is the details of the permission of the docker.socket of the vscode docker plug-in. For more information about the permission of the docker socket, please pay attention to other related articles of developeppaer!

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]