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

Use the remote docker daemon with docker context get error invalid mount config for type "bind": bind source path does not exist #3330

Closed
Aisuko opened this issue Jul 8, 2020 · 4 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@Aisuko
Copy link

Aisuko commented Jul 8, 2020

  • VSCode Version:

    1.46.1
    cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
    x64
    
  • Local OS Version:

    macOS Catalina 10.15.5
    
    Darwin TIfa.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
    
  • Remote OS Version:

    ubuntu20.04 Destop
    Linux redthirteen 5.4.0-39-generic #43-Ubuntu SMP Fri Jun 19 10:28:31 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    
  • Remote Extension/Connection Type: SSH/Docker/WSL

    ms-vscode-remote.remote-containers v0.122.1
    

Steps to Reproduce:

  1. git clone the VSCODE-REMOTE-TRY-GO and Open the current folder in the container
  2. Keep the extensions running, will get the issue

Does this issue occur when you try this locally?: Yes/No

[13 ms] Start: Resolving remote
[15 ms] Setting up container for folder or workspace: /Users/aisuko/Documents/vscode-remote-try-go

[18 ms] Start: Run: git rev-parse --show-toplevel
[29 ms] Start: Check Docker is running
[29 ms] Start: Run: docker info
[853 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/Users/aisuko/Documents/vscode-remote-try-go --filter label=vsch.quality=stable
[1326 ms] Start: Run: docker build -f /Users/aisuko/Documents/vscode-remote-try-go/.devcontainer/Dockerfile -t vsc-vscode-remote-try-go-527156e00e9bb81e05bf662b11e69a2a /Users/aisuko/Documents/vscode-remote-try-go/.devcontainer
Sending build context to Docker daemon  7.168kB
Step 1/2 : FROM aisuko/golang:v1.14
 ---> cae7af0ca2f9
Step 2/2 : ENV GOPROXY="https://goproxy.io,direct"
 ---> Using cache
 ---> 1b05c0288549
Successfully built 1b05c0288549
Successfully tagged vsc-vscode-remote-try-go-527156e00e9bb81e05bf662b11e69a2a:latest
[1968 ms] Start: Run: docker events --format {{json .}} --filter status=start
[1971 ms] Start: Starting container
[1971 ms] Start: Run: docker run -a STDOUT -a STDERR --mount type=bind,source=/Users/aisuko/Documents/vscode-remote-try-go,target=/workspaces/vscode-remote-try-go,consistency=cached -l vsch.quality=stable -l vsch.remote.devPort=0 -l vsch.local.folder=/Users/aisuko/Documents/vscode-remote-try-go --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --entrypoint /bin/sh vsc-vscode-remote-try-go-527156e00e9bb81e05bf662b11e69a2a -c echo Container started ; while sleep 1; do :; done
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /Users/aisuko/Documents/vscode-remote-try-go.
See 'docker run --help'.
[2191 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/Users/aisuko/Documents/vscode-remote-try-go --filter label=vsch.quality=stable
[2386 ms] Command failed: docker run -a STDOUT -a STDERR --mount type=bind,source=/Users/aisuko/Documents/vscode-remote-try-go,target=/workspaces/vscode-remote-try-go,consistency=cached -l vsch.quality=stable -l vsch.remote.devPort=0 -l vsch.local.folder=/Users/aisuko/Documents/vscode-remote-try-go --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --entrypoint /bin/sh vsc-vscode-remote-try-go-527156e00e9bb81e05bf662b11e69a2a -c echo Container started ; while sleep 1; do :; done

Just manually run the command at local

➜  vscode-remote-try-go git:(master) ✗ docker run -a STDOUT -a STDERR --mount type=bind,source=/Users/aisuko/Documents/vscode-remote-try-go,target=/workspaces/vscode-remote-try-go,consistency=cached -l vsch.quality=stable -l vsch.remote.devPort=0 -l vsch.local.folder=/Users/aisuko/Documents/vscode-remote-try-go --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --entrypoint /bin/sh vsc-vscode-remote-try-go-527156e00e9bb81e05bf662b11e69a2a -c echo Container started ; while sleep 1; do :; done
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /Users/aisuko/Documents/vscode-remote-try-go.
See 'docker run --help'.
➜  vscode-remote-try-go git:(master) ✗ docker context ls
NAME                DESCRIPTION                               DOCKER ENDPOINT               KUBERNETES ENDPOINT   ORCHESTRATOR
Redthirdteen *                                                ssh://[email protected]:22                         
default             Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                         swarm

Does this issue occur when you try this locally and all extensions are disabled?: Yes/No

Docker version&&info

Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:21:11 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.8
  Git commit:       afacb8b7f0
  Built:            Wed Mar 11 22:48:33 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.3-0ubuntu2
  GitCommit:        
 runc:
  Version:          spec: 1.0.1-dev
  GitCommit:        
 docker-init:
  Version:          0.18.0
  GitCommit:        
➜  vscode-remote-try-go git:(master) ✗ docker info
Client:
 Debug Mode: false

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 11
 Server Version: 19.03.8
 Storage Driver: overlay2
  Backing Filesystem: <unknown>
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-39-generic
 Operating System: Ubuntu 20.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.15GiB
 Name: redthirteen
 ID: 45BG:GOEC:A7YV:VGOF:VRAI:OXAS:22PC:KWTF:G4TO:6NRJ:AHPR:63LF
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: socks5://127.0.0.1:2180
 HTTPS Proxy: socks5://127.0.0.1:2180
 No Proxy: localhost,127.0.0.1,docker-registry.example.com,.corp,.deepexi.com
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Because of the network speed, the aisuko/golang:v1.14 is from the base image vscode-remote-try-go and it can work very well when the daemon at local host.

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jul 8, 2020
@chrmarti
Copy link
Contributor

chrmarti commented Jul 8, 2020

Bind mounts are relative to the filesystem the Docker daemon runs with. If that runs on a different machine, it cannot mount your local folder.

@chrmarti chrmarti self-assigned this Jul 8, 2020
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jul 8, 2020
@Aisuko
Copy link
Author

Aisuko commented Jul 8, 2020

Bind mounts are relative to the filesystem the Docker daemon runs with. If that runs on a different machine, it cannot mount your local folder.

Thanks for your quick reply, sir. Is there any solution for debugging in the container use remote docker daemon? I try to find way useful like to use VSCODE extensions ms-vscode-remote.remote-ssh open remote project and run Open the current folder in the container, but VSCODE does nothing.

@chrmarti
Copy link
Contributor

chrmarti commented Jul 9, 2020

You could use a Docker volume: F1 > Remote-Containers: Open Repository in Container... will ask for a Git URL and then clone that repository into a Docker volume.

Or you could update the bind mount to match a folder on the remote filesystem: https://code.visualstudio.com/docs/remote/containers-advanced#_changing-the-default-source-code-mount

Reopen in Container while connected via Remote-SSH is tracked as #2994.

@Aisuko
Copy link
Author

Aisuko commented Jul 10, 2020

@chrmarti Thank you very much, sir. It works for me.

@Aisuko Aisuko closed this as completed Jul 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2020
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
Projects
None yet
Development

No branches or pull requests

2 participants