This issue concerns the syntax used in the included/README examples for Bind mounts of Cypress projects using the CLI option -v and the environment variable PWD (Print Working Directory), for example:
$ docker run -it -v $PWD:/e2e -w /e2e cypress/included:13.10.0
If the path of the current working directory represented by PWD contains spaces, then the command fails with an error message:
docker: invalid reference format
If the syntax -v $PWD:/e2e is used on Windows PowerShell then the command fails with an error message:
At line:1 char:21
+ $ docker run -it -v $PWD:/e2e -w /e2e cypress/included:13.10.0
+ ~~~~~
Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidVariableReferenceWithDrive
Relative paths can replace the use of the environment variable PWD. This avoids problems with PWD, enabling equivalent functionality and it simplifies the command line examples.
Change
Change all examples using docker run with mount volume -v using PWD to instead use the relative path ., so for example:
$ docker run -it -v $PWD:/e2e -w /e2e cypress/included:13.10.0
is changed to
$ docker run -it -v .:/e2e -w /e2e cypress/included:13.10.0
Verification
Ubuntu
On Ubuntu 22.04.4 LTS with Docker Desktop for Linux v4.30.0
mkdir "cy example"
cd "cy example"
git init
npm init -y
npm install cypress
npx cypress open
Select "E2E Testing"
Select "Continue"
Select "Electron" and "Start E2E Testing in Electron"
Issues
This issue concerns the syntax used in the included/README examples for Bind mounts of Cypress projects using the CLI option
-v
and the environment variablePWD
(Print Working Directory), for example:If the path of the current working directory represented by
PWD
contains spaces, then the command fails with an error message:If the syntax
-v $PWD:/e2e
is used on Windows PowerShell then the command fails with an error message:Relative paths
docker container run
with aliasdocker run
provides the option Mount volume (-v) with relative paths as described in the Docker documentation:Relative paths can replace the use of the environment variable
PWD
. This avoids problems withPWD
, enabling equivalent functionality and it simplifies the command line examples.Change
Change all examples using
docker run
with mount volume-v
usingPWD
to instead use the relative path.
, so for example:is changed to
Verification
Ubuntu
On Ubuntu
22.04.4
LTS with Docker Desktop for Linuxv4.30.0
Confirm that Cypress runs successfully.
Windows
On Windows
11 23H2
with Docker Desktop for Windowsv4.30.0
Test as for Ubuntu (described above) using:
On Git Bash test with: