Unable to mount volume with docker on Space Dev Environments

I have just started testing Space dev environments and I was trying to run docker containers in that. But I am unable to mount the source code volume in my containers.

I followed the instructions in the Space docs

Here is an attached screenshot of the terminal in the remote dev environment -

I am running an Ubuntu container in this case to demonstrate the issue. It seems that the environment variable $HOST_PROJECT_PATH is not getting resolved.

I have tried the following volume paths as well and nothing seems to be working

docker run -v $HOST_PROJECT_PATH/squadrun:/var/opt/project -it ubuntu:latest
docker run -v $HOST_PROJECT_PATH/work/squadrun:/var/opt/project -it ubuntu:latest
docker run -v $HOST_PROJECT_PATH/space/work/squadrun:/var/opt/project -it ubuntu:latest
docker run -v $HOST_PROJECT_PATH/mnt/space/work/squadrun:/var/opt/project -it ubuntu:latest

 

Does this seem like a valid issue or am I missing something here?

2
3 comments

Kunal - hi,

Thank you for your question!

Could you please try the following:

docker run --rm -it -v $HOST_PROJECT_PATH:/project -w /project ubuntu:20.04

Please let me know if you have additional questions or if this approach doesn't work for you.

 

Margarita Kolotilova
JetBrains
http://www.jetbrains.com
The Drive to Develop

0

I have the same issue. I tried your solution Margarita Kolotilova but the repository is empty. Also the $HOST_PROJECT_PATH variable is empty as well - I think that might be the issue? Should I be able to print the variable?

 

Kunal Yadav did you figure this out?

0

Markus - hi,

Thank you for notifying us about that!

Please try to use the following command (when running it in project dir) to start ubuntu container with a mounted project:

docker run --rm -it -v $(pwd):/project -w /project ubuntu:20.04

Please let us know about the results.

Margarita Kolotilova
JetBrains
http://www.jetbrains.com
The Drive to Develop

0

Please sign in to leave a comment.