Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using different path for docker.sock (Docker rootless mode) #7354

Closed
akanok opened this issue Oct 13, 2022 · 9 comments
Closed

Using different path for docker.sock (Docker rootless mode) #7354

akanok opened this issue Oct 13, 2022 · 9 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster rootless

Comments

@akanok
Copy link

akanok commented Oct 13, 2022

Im using docker in rootless mode the docker.sock file is located at unix:///run/user/<UID>/docker.sock but the extension search it in the default path unix:///var/run/docker.sock

  • VSCode Version: 1.72.1
  • Local OS Version: Manjaro Linux 5.15.72-1-MANJARO
  • Remote Extension/Connection Type: Containers
  • Logs:
[44506 ms] Start: Run in container: docker ps -q -a --filter label=vsch.local.repository=https://github.com/Microsoft/vscode-remote-try-dotnetcore --filter label=vsch.local.repository.volume=vscode-remote-try-dotnetcore-530c3f5a1471c73527da5f01ad9a2a80 --filter label=vsch.local.repository.folder=vscode-remote-try-dotnetcore --filter label=vsch.quality=stable
[44620 ms] Stop (114 ms): Run in container: docker ps -q -a --filter label=vsch.local.repository=https://github.com/Microsoft/vscode-remote-try-dotnetcore --filter label=vsch.local.repository.volume=vscode-remote-try-dotnetcore-530c3f5a1471c73527da5f01ad9a2a80 --filter label=vsch.local.repository.folder=vscode-remote-try-dotnetcore --filter label=vsch.quality=stable
[44624 ms] Command failed: docker ps -q -a --filter label=vsch.local.repository=https://github.com/Microsoft/vscode-remote-try-dotnetcore --filter label=vsch.local.repository.volume=vscode-remote-try-dotnetcore-530c3f5a1471c73527da5f01ad9a2a80 --filter label=vsch.local.repository.folder=vscode-remote-try-dotnetcore --filter label=vsch.quality=stable
[44624 ms] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[44624 ms] Exit code 1

Steps to Reproduce:

  1. Install the extension for vscode: ms-vscode-remote.remote-containers
  2. Open command palette and type Dev Containers: Show Container Log
  3. Open command palette and type remote-containers.trySample or Dev Containers: Try a Dev Container Sample...
  4. Select sample repo, in my case .NET Core

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes, all other extension are disabled

Is it possible to use this exension with docker in rooless mode ?
Is there a way to change the path where it looks for the docker.sock ?

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Oct 13, 2022
@dnns92
Copy link

dnns92 commented Oct 24, 2022

I also have this issue

@KhanlianCkn
Copy link

Hi, we also experienced this. We tried to set the DOCKER_HOST settings with no success. Right now we use we as a dirty hack a symlink between the original docker.sock and the actual one. Would be nice to have a proper way to fix this issue.

@chrmarti
Copy link
Contributor

Try setting it in the VS Code user settings (requires the Docker extension to be installed):
image

@chrmarti chrmarti self-assigned this Oct 25, 2022
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Oct 25, 2022
@dnns92
Copy link

dnns92 commented Oct 25, 2022

@chrmarti
I have already set this in all possible variations of settings: user, workspace, remote, etc. it always falls back to the default docker socket settings.

@akanok
Copy link
Author

akanok commented Nov 1, 2022

Hi, we also experienced this. We tried to set the DOCKER_HOST settings with no success. Right now we use we as a dirty hack a symlink between the original docker.sock and the actual one. Would be nice to have a proper way to fix this issue.

I have tried it:
sudo ln -s /run/user/$UID/docker.sock /var/run/docker.sock
but without success.

This is what I got:

$ ls -al /run/user/$UID/docker.sock
srw-rw---T 1 <UID> <UID> 0 /run/user/1000/docker.sock
$ ls -al /var/run/docker.sock
lrwxrwxrwx 1 root root 26 /var/run/docker.sock -> /run/user/$UID/docker.sock

@akanok
Copy link
Author

akanok commented Nov 1, 2022

@chrmarti what are the additional info you need?

@nfishe
Copy link

nfishe commented May 18, 2023

I'm seeing this issue as well. All other actions work i.e. Attach Shell, Logs. The Attach VSCode is the only one who is stuck on the rootful sock and I cannot for the life of me figure out where it's stemming from.

@github-actions
Copy link

Hey @chrmarti, this issue might need further attention.

@akanok, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@github-actions
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster rootless
Projects
None yet
Development

No branches or pull requests

5 participants