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

Docker mode doesn't work on Windows #383

Open
dmitrc opened this issue Mar 27, 2024 · 2 comments
Open

Docker mode doesn't work on Windows #383

dmitrc opened this issue Mar 27, 2024 · 2 comments

Comments

@dmitrc
Copy link

dmitrc commented Mar 27, 2024

Bug description

On Windows, process.cwd() includes a colon (:), which breaks the -v argument to the Docker CLI.

Status: Downloaded newer image for lostpixel/lost-pixel:v3.16.0
docker: Error response from daemon: invalid mode: \src\myproject.
See 'docker run --help'.
❌ Error: Command failed with exit code 125: docker run --rm -v D:\src\myproject:D:\src\myproject -e WORKSPACE=D:\src\myproject -e DOCKER=1     lostpixel/lost-pixel:v3.16.0
    at makeError (D:\src\myproject\node_modules\execa\lib\error.js:60:11)
    at handlePromise (D:\src\myproject\node_modules\execa\index.js:118:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runInDocker (D:\src\myproject\node_modules\lost-pixel\dist\docker-runner\index.js:12:13)
    at async D:\src\myproject\node_modules\lost-pixel\dist\bin.js:32:9 {

Here is the relevant line in source code:
https://github.com/lost-pixel/lost-pixel/blob/6db31948aef97f10ea9c7b1a8fa8dd3a0ce2dd49/src/docker-runner/utils.ts#L23C5-L23C44

How to reproduce

  1. Initialize latest Lost Pixel on Windows in OSS mode for any project (I used Storybook bindings)
  2. Run npx lost-pixel docker
  3. Observe the error message quoted above

Expected behavior

Docker mode generates the images and diff them as expected

Lost Pixel information

N/A

lost-pixel logs from CI

N/A

@d-ivashchuk
Copy link
Collaborator

Thanks for reporting @dmitrc! mind creating a PR to fix this?

@dmitrc
Copy link
Author

dmitrc commented Mar 27, 2024

I can try to find time around the end of the week, but if you can get to it sooner, please be my guest.

From my brief research, the first value (before :) can stay as-is and the second one can be changed to be some arbitrary Linux path (eg /usr/workdir). Not entirely sure if that will cause cascading effects that would need to be updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants