microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 293 forks source link

Problem running "git clone", in a specific folder using "WORKDIR" #5206

Closed patchie closed 3 years ago

patchie commented 3 years ago

I have setup vscode(win10) with "remote-container" extension. Installed docker, and i am starting docker from vscode using a dockerfile. It works perfect, until i want to download a git repo from the dockerfile. If i run the following command, it works, but it puts it under / ,root folder: RUN git clone https://github.com/daniel-thompson/wasp-os So i imagine that i could do RUN cd /workspaces/docker, but it fails, so i end up finding the following docker command:

WORKDIR /workspaces/docker 
RUN git clone https://github.com/daniel-thompson/wasp-os

But when i rebuild, it doesn't put it under the folder i want it to, and i cant find it anywhere. No error messages.

logfile:

[2021-06-15T20:33:29.661Z] 
[+] Building 0.9s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 1.40kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/p  0.8s
 => [1/4] FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.9@sha256  0.0s
 => CACHED [2/4] RUN mkdir -p /workspaces/docker                           0.0s
 => CACHED [3/4] WORKDIR /workspaces/docker                                0.0s
 => CACHED [4/4] RUN git clone https://github.com/daniel-thompson/wasp-os  0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:0fad0c0a882ee480d8374263f8ec040cb715dac8e58dc  0.0s
 => => naming to docker.io/library/vsc-docker-4cc7420cc799c5c2635fee05be1  0.0s
[2021-06-15T20:33:30.099Z] 
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and l
earn how to fix them
[2021-06-15T20:33:30.128Z] 
[2021-06-15T20:33:30.220Z] Stop (3321 ms): Run: docker build -f c:\Users\username\Google Drive\!programmering\!python\PineTime\docker\.devcontainer\Dockerfile -t vsc-docker-4cc7420cc799c5c2635fee05be1ffd3d --build-arg VARIANT=3.9 --build-arg INSTALL_NODE=true --build-arg NODE_VERSION=lts/* c:\Users\username\Google Drive\!programmering\!python\PineTime\docker
[2021-06-15T20:33:30.221Z] Start: Run: docker events --format {{json .}} --filter event=start
[2021-06-15T20:33:30.257Z] Start: Starting container
[2021-06-15T20:33:30.257Z] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=c:\Users\username\Google Drive\!programmering\!python\PineTime\docker,target=/workspaces/docker,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=c:\Users\username\Google Drive\!programmering\!python\PineTime\docker -l vsch.quality=stable -l vsch.remote.devPort=0 --entrypoint /bin/sh vsc-docker-4cc7420cc799c5c2635fee05be1ffd3d -c echo Container started ; trap "exit 0" 15; while sleep 1 & wait $!; do :; done
[2021-06-15T20:33:30.500Z] 
[2021-06-15T20:33:32.140Z] Container started
[2021-06-15T20:33:32.149Z] Stop (1892 ms): Starting container
chrmarti commented 3 years ago

/workspaces/docker is likely mounted on your local folder. Try using, e.g., WORKDIR /workspaces.

github-actions[bot] commented 3 years ago

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!