Ubuntu VSCode Docker 权限

报错 permission denied

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied

The terminal process "/usr/bin/bash '-c', 'docker build --pull --rm -f "Dockerfile" -t 4dsegment3:jzheng0 "."'" failed to launch (exit code: 1).
Terminal will be reused by tasks, press any key to close it.

处理

The error message indicates that your user does not have the necessary permissions to access the Docker daemon. To resolve this, you can add your user to the docker group and then restart your session. Here are the steps:

Add your user to the docker group:

sudo usermod -aG docker $USER

Restart your session:

Log out and log back in, or
Restart your computer, or
Use the following command to start a new shell with the updated group

newgrp docker

membership:
After performing these steps, try running the docker build command again.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值