Environment variables in Docker bind mount

Hi there,

I'm trying to mount a folder under my user profile in a docker container, but when run Rider is unable to handle the embedded colon and fails with message "Failed to deploy 'my-cloud-app Image id: my-cloud-app': Illegal char <:> at index 4: $env:USERPROFILE\.aspnet\https".

The equivalent command line runs fine in Powershell and I've been able to map host environment variables through in the Environment variables field.

Is there an alternate syntax I might be able to use to expand an environment variable in the bind mount in Rider?





Hi Alexandra,

Thanks for getting back to me. Unfortunately the %USERPROFILE% style syntax doesn't seem to work either:

If I use linux style paths on the windows side (i.e. %USERPROFILE%/.aspnet/https:/https) the error is a little more specific indicating that only absolute paths are supported.

Just to clarify my previous comment, I can pass environment variables into the docker build command but it does seem to be explicitly supported there.

I haven't found a way to pass environment variables to the docker run command using any syntax, I'm guessing it might not be supported at this time?


Hi Scott! 

Could you please try %USERPROFILE% and let me know if it works? Thanks! 


Hello Seckford,

Thank you for bringing more details. 

Unfortunately, the issue you have faced is a known one with the ID IDEA-289332. You are correct that at the moment passing the variables is not supported in Run Configurations. Please upvote the issue for a bigger awareness and receiving update on the progress. 

Thank you and have a nice day!


I just stumbled on the same annoying bug. It kind of ruins the docker experience within Rider.


Please sign in to leave a comment.