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

Remote - Containers Add support for Docker Toolbox #95

Open
hsm207 opened this issue May 3, 2019 · 10 comments
Open

Remote - Containers Add support for Docker Toolbox #95

hsm207 opened this issue May 3, 2019 · 10 comments
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality

Comments

@hsm207
Copy link

hsm207 commented May 3, 2019

  • VSCode Version: 1.34.0-insider (user-setup)
  • Local OS Version: Windows 10 Home 10.0.17134 Build 17134
  • Remote OS Version: continuumio/miniconda3
  • Remote Extension/Connection Type: Docker

Steps to Reproduce:

  1. Create a folder named 'hello'
  2. Open that folder inside vscode insiders
  3. Execute: Remote-Containers: Open Folder in Container...
  4. Select Python 3 - Miniconda.

You will get a message saying An error occurred setting up the container.. This is the output from the terminal:

Setting up container for folder: c:\Users\user\AppData\Local\Temp\hello
Run: docker build -f c:\Users\user\AppData\Local\Temp\hello\.devcontainer\Dockerfile -t vsc-hello-05eeced32ecee643b6fb6bf3355667ae c:\Users\user\AppData\Local\Temp\hello
Sending build context to Docker daemon  19.46kB
Step 1/9 : FROM continuumio/miniconda3
 ---> ae46c364060f
Step 2/9 : COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
 ---> Using cache
 ---> 149413d5be42
Step 3/9 : RUN apt-get update && apt-get -y install git procps
 ---> Using cache
 ---> 979f144b612e
Step 4/9 : RUN mkdir /workspace
 ---> Using cache
 ---> 48c26a0881a2
Step 5/9 : WORKDIR /workspace
 ---> Using cache
 ---> 5839073e3211
Step 6/9 : RUN pip install pylint
 ---> Using cache
 ---> 046bb80f2dc4
Step 7/9 : COPY .devcontainer/environment.yml.temp environment.yml* /workspace/
 ---> Using cache
 ---> 5bc26fe87c5b
Step 8/9 : RUN if [ -f "environment.yml" ]; then conda env update base -f environment.yml && rm environment.yml*; fi
 ---> Using cache
 ---> 82155bdabf5c
Step 9/9 : RUN apt-get autoremove -y     && apt-get clean -y     && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 5995bbf8ebac
Successfully built 5995bbf8ebac
Successfully tagged vsc-hello-05eeced32ecee643b6fb6bf3355667ae:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
Run: docker run -a STDOUT -a STDERR -v c:\Users\user\AppData\Local\Temp\hello:/workspaces/hello -v C:\Users\user\.gitconfig:/root/.gitconfig -l vsch.quality=insider -l vsch.local.folder=c:\Users\user\AppData\Local\Temp\hello -l vsch.remote.devPort=9753 vsc-hello-05eeced32ecee643b6fb6bf3355667ae /bin/sh -c echo Container started ;  while sleep 1; do :; done
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: /workspaces/hello.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.
Failed: Starting the development container
Command failed: C:\Program Files\Docker Toolbox\docker.exe run -a STDOUT -a STDERR -v c:\Users\user\AppData\Local\Temp\hello:/workspaces/hello -v C:\Users\user\.gitconfig:/root/.gitconfig -l vsch.quality=insider -l vsch.local.folder=c:\Users\user\AppData\Local\Temp\hello -l vsch.remote.devPort=9753 vsc-hello-05eeced32ecee643b6fb6bf3355667ae /bin/sh -c echo Container started ;  while sleep 1; do :; done

I think the issue may be related to this question on Stackoverflow.

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

@cwendt94
Copy link

cwendt94 commented May 5, 2019

I am also experiencing the same issue using the vscode-remote-try-python. I am using Docker Toolbox on Windows 10 Home. VSCode Version 1.34.0-insider (user setup)


Run: docker build -f c:\Users\Christian and Kim\docker-containers\vscode-remote-try-python\.devcontainer\Dockerfile -t vsc-vscode-remote-try-python-b04591e1dca6a6f82826a4dce546ea78 c:\Users\Christian and Kim\docker-containers\vscode-remote-try-python
Sending build context to Docker daemon  223.2kB
Step 1/10 : FROM python:3
 ---> 954987809e63
Step 2/10 : COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
 ---> Using cache
 ---> 88740288a07c
Step 3/10 : RUN pip install pylint
 ---> Using cache
 ---> 3dc98e71ac4a
Step 4/10 : RUN apt-get update && apt-get -y install git procps
 ---> Using cache
 ---> 098c95b0dd01
Step 5/10 : RUN apt-get install -y libicu[0-9][0-9]
 ---> Using cache
 ---> d8569b483680
Step 6/10 : RUN mkdir /workspace
 ---> Using cache
 ---> b8089a0a541e
Step 7/10 : WORKDIR /workspace
 ---> Using cache
 ---> 7bb147676bfe
Step 8/10 : COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/
 ---> Using cache
 ---> 681041744b77
Step 9/10 : RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt*; fi
 ---> Using cache
 ---> 754eedcec742
Step 10/10 : RUN apt-get autoremove -y     && apt-get clean -y     && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 60605ff565a5
Successfully built 60605ff565a5
Successfully tagged vsc-vscode-remote-try-python-b04591e1dca6a6f82826a4dce546ea78:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
Run: docker run -a STDOUT -a STDERR -p 127.0.0.1:9000:9000 -v c:/Users/Christian and Kim/docker-containers/vscode-remote-try-python:/workspaces/vscode-remote-try-python -v C:\Users\Christian and Kim\.gitconfig:/root/.gitconfig -l vsch.quality=insider -l vsch.local.folder=c:\Users\Christian and Kim\docker-containers\vscode-remote-try-python -l vsch.remote.devPort=9753 vsc-vscode-remote-try-python-b04591e1dca6a6f82826a4dce546ea78 /bin/sh -c echo Container started ;  while sleep 1; do :; done
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: /workspaces/vscode-remote-try-python.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.
Failed: Starting the development container
Command failed: C:\Program Files\Docker Toolbox\docker.exe run -a STDOUT -a STDERR -p 127.0.0.1:9000:9000 -v c:/Users/Christian and Kim/docker-containers/vscode-remote-try-python:/workspaces/vscode-remote-try-python -v C:\Users\Christian and Kim\.gitconfig:/root/.gitconfig -l vsch.quality=insider -l vsch.local.folder=c:\Users\Christian and Kim\docker-containers\vscode-remote-try-python -l vsch.remote.devPort=9753 vsc-vscode-remote-try-python-b04591e1dca6a6f82826a4dce546ea78 /bin/sh -c echo Container started ;  while sleep 1; do :; done```

@cwendt94
Copy link

cwendt94 commented May 5, 2019

Upon further investigation it does seem like the issue is a path issue when trying to mount local directory through VirtualBox VM that is running the container.

I found a work around using docker compose. I am using docker-compose version 1.20.1
Steps for workaround with sample python :

  1. git clone https://github.com/Microsoft/vscode-remote-try-python
  2. Open vscode-remote-try-python directory in VSCode Insider
  3. create docker-compose.yml inside .devcontainer/ with contents
version: '3'
services:
web:
 build:
   context: ..
   # Location is relative to folder containing this compose file
   dockerfile: .devcontainer/Dockerfile
 volumes:
   - ..:/workspace
 command: sleep infinity
  1. Update .devcontainer/devcontainer.json file to
{
   "name": "Python Sample",
   "dockerComposeFile": [
      "docker-compose.yml"
    ],
    "service": "web",
    "workspaceFolder": "/workspace",
    "shutdownAction": "stopCompose",
    "extensions": [
	"ms-python.python"
    ]
}
  1. In VSCode Run Remote-Containers: Reopen Folder in Container
  2. My Output
Setting up container for folder: c:\Users\vscode-remote-try-python
Run: docker-compose -f c:\Users\vscode-remote-try-python\.devcontainer\docker-compose.yml up -d
Starting devcontainer_web_1 ... done
Run: docker exec be0ee6e4cc620fda4ba4d986a038fc3eddc6cd9b6ef9f51b5197e1e33fec88a7 /bin/sh -c (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Run: docker exec be0ee6e4cc620fda4ba4d986a038fc3eddc6cd9b6ef9f51b5197e1e33fec88a7 test -d /root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9
Run: docker exec be0ee6e4cc620fda4ba4d986a038fc3eddc6cd9b6ef9f51b5197e1e33fec88a7 test -d /root/.vscode-remote/extensions
Run: docker exec be0ee6e4cc620fda4ba4d986a038fc3eddc6cd9b6ef9f51b5197e1e33fec88a7 test -f /root/.vscode-remote/.postCreateCommandMarker
Run: docker exec -w /root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9 -u 0 be0ee6e4cc620fda4ba4d986a038fc3eddc6cd9b6ef9f51b5197e1e33fec88a7 /bin/sh -c command -v git >/dev/null 2>&1 && git config --system credential.helper '!f() { command -v code-insiders >/dev/null 2>&1 && code-insiders --gitCredential $*; }; f' || true
Run: docker exec -w /root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9 be0ee6e4cc620fda4ba4d986a038fc3eddc6cd9b6ef9f51b5197e1e33fec88a7 /bin/sh -c PATH="/root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9/bin:$PATH" /root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9/server.sh  --port 9753
Remote configuration data at /root/.vscode-remote


*
* Visual Studio Code Server
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license https://aka.ms/vscode-remote/license
*


IP Address: 172.19.0.2
Extension host agent listening on 9753
==> Received an extension host connection.
==> Using UI language: en
==> Received a management connection
==> Received a management connection

docker-compose is able to mount the volumes correctly through the Virtual Box VM to the newly built container.

To get regular Docker Toolbox to work I think the path needs to be /c/Users/vscode-remote-try-python instead of c:\Users\vscode-remote-try-python because that is the path inside the Docker VM.

@egamma egamma added feature-request Request for new features or functionality doc labels May 6, 2019
@egamma
Copy link
Member

egamma commented May 6, 2019

We currently do not support Docker Toolbox on Windows 10 Home.

@Chuxel fyi @alexandrudima got it up and running, but we did not document it yet and we do not test in this setup. So we should document it as not supported currently.

@egamma egamma changed the title Remote - Containers does not work with Docker Toolbox Remote - Containers Add support for Docker Toolbox May 6, 2019
@Chuxel Chuxel removed the doc label May 6, 2019
@Chuxel Chuxel removed their assignment May 6, 2019
@Chuxel
Copy link
Member

Chuxel commented May 6, 2019

@egamma Added to docs and READMEs and will go out next push. Removed "docs" and unassigned myself since I assume we want to keep this around for the broader feature request.

@0Grit
Copy link

0Grit commented Jun 4, 2019

Docker for windows is a little invasive. I don't want to require our developers to install it.
Is there an alternative path we can try?
IE: Remote docker host development by including docker cli in project repository, docker machine, or docker toolbox.

@chrmarti
Copy link
Contributor

chrmarti commented Jun 5, 2019

@tolgabalci
Copy link

I am also experiencing the same issue. Running Docker Desktop on Windows 10 Enterprise.

I just today installed: A) VSCode 1.35.0 and B) Remote Development Pack.

Error is can be replicated every time in three steps:

After the above Docker Desktop prompts:

Docker Desktop - Share drive
Docker wants to access drive C:\,
Do you want to share it ?
[Share it] [Cancel]

I click on [Share it]

Then Visual Studio Code prompts:

"An error occurred setting up the container"
[Retry] [Close Remote] [More Actions...]

Here is the console output:

Setting up container for folder: t:\vscode-remote\vscode-remote-try-python
Run: docker build -f t:\vscode-remote\vscode-remote-try-python\.devcontainer\Dockerfile -t vsc-vscode-remote-try-python-e645152ad1347be03896531477b91b83 t:\vscode-remote\vscode-remote-try-python
Sending build context to Docker daemon  240.6kB
Step 1/13 : FROM python:3
 ---> a4cc999cf2aa
Step 2/13 : RUN pip install pylint
 ---> Using cache
 ---> 4e111f402d3e
Step 3/13 : ENV DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 6989c3e5c559
Step 4/13 : RUN apt-get update     && apt-get -y install --no-install-recommends apt-utils 2>&1
 ---> Using cache
 ---> 2055e0693273
Step 5/13 : RUN apt-get -y install git procps lsb-release
 ---> Using cache
 ---> ff1d0b12fc81
Step 6/13 : RUN apt-get install -y libicu[0-9][0-9]
 ---> Using cache
 ---> e81edc9a0d10
Step 7/13 : RUN mkdir /workspace
 ---> Using cache
 ---> c84c30a930be
Step 8/13 : WORKDIR /workspace
 ---> Using cache
 ---> bed35187e741
Step 9/13 : COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/
 ---> Using cache
 ---> eb8e95e587f6
Step 10/13 : RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt*; fi
 ---> Using cache
 ---> 803938177df9
Step 11/13 : RUN apt-get autoremove -y     && apt-get clean -y     && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 885423d43b75
Step 12/13 : ENV DEBIAN_FRONTEND=dialog
 ---> Using cache
 ---> 5f56fde641f6
Step 13/13 : ENV SHELL /bin/bash
 ---> Using cache
 ---> 435034061c52
Successfully built 435034061c52
Successfully tagged vsc-vscode-remote-try-python-e645152ad1347be03896531477b91b83:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
Run: docker run -a STDOUT -a STDERR -p 127.0.0.1:9000:9000 --mount type=bind,source=t:/vscode-remote/vscode-remote-try-python,target=/workspaces/vscode-remote-try-python -v /host_mnt/c/Users/tolga/.gitconfig:/root/.gitconfig -l vsch.quality=stable -l vsch.local.folder=t:\vscode-remote\vscode-remote-try-python -l vsch.remote.devPort=0 vsc-vscode-remote-try-python-e645152ad1347be03896531477b91b83 /bin/sh -c echo Container started ;  while sleep 1; do :; done
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: Drive sharing seems blocked by a firewall.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
Failed: Starting the development container
Command failed: C:\Program Files\Docker\Docker\Resources\bin\docker.exe run -a STDOUT -a STDERR -p 127.0.0.1:9000:9000 --mount type=bind,source=t:/vscode-remote/vscode-remote-try-python,target=/workspaces/vscode-remote-try-python -v /host_mnt/c/Users/tolga/.gitconfig:/root/.gitconfig -l vsch.quality=stable -l vsch.local.folder=t:\vscode-remote\vscode-remote-try-python -l vsch.remote.devPort=0 vsc-vscode-remote-try-python-e645152ad1347be03896531477b91b83 /bin/sh -c echo Container started ;  while sleep 1; do :; done

@chrmarti
Copy link
Contributor

chrmarti commented Jun 7, 2019

@tolgabalci Your issue is different: Error response from daemon: Drive sharing seems blocked by a firewall.

docker/for-win#738 suggests to check your firewall and disable any VPN. docker/for-win#738 (comment) seems to have helped a few users too.

@djensen47
Copy link

djensen47 commented Aug 9, 2019

So I'm seeing the error as well on Docker Desktop

You are building a Docker image from Windows against a non-Windows Docker host

The problem it poses for me is that all the file permissions are changed and git thinks ALL files have been changed.

@cloudbring
Copy link

I ran into this same problem. At first, I had a project with a .devcontainer folder on Windows (10 Pro - Version 10.0.18362 Build 18362). The project was located in Documents in my personal folder.

I opened up the same exact project copied to outside my personal folder space (D:/vscode/project basically) and that fixed everything. This might be a Windows file path issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

10 participants