Skip to content

Commit

Permalink
Improve ./start to work on Windows (#2421)
Browse files Browse the repository at this point in the history
Closes #1607. There are
two issues:

1. The shebang will be ignored, so you need to run `python ./start`
instead of `./start`
2. Volume mounting with Docker on Windows uses Unix-style path, per
https://medium.com/@kale.miller96/how-to-mount-your-current-working-directory-to-your-docker-container-in-windows-74e47fa104d7
  • Loading branch information
Eric-Arellano authored Dec 18, 2024
1 parent bbbc6a9 commit fbd0875
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ You can preview the docs locally by following these two steps:

1. Ensure Docker is running. For example, open Rancher Desktop.
2. Run `./start` in your terminal, and open http://localhost:3000 in your browser.
- On Windows, run `python start` instead. Alternatively, use Windows Subsystem for Linux and run `./start`.

The preview application does not include the top nav bar. Instead, navigate to the folder you want with the links in the home page. You can return to the home page at any time by clicking "IBM Quantum Documentation Preview" in the top-left of the header.

Expand Down
5 changes: 4 additions & 1 deletion start
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ from pathlib import Path
# Get the latest digest by running `docker pull icr.io/qc-open-source-docs-public/preview:latest`.
IMAGE_DIGEST = "sha256:00708d7f6926826fbea7e1469380ffc7cdccf540760d0be1828d88c31cd7def8"

PWD = Path(__file__).parent
# Docker on Windows uses `/` rather than `\`, so we need to call `.as_posix()`:
# https://medium.com/@kale.miller96/how-to-mount-your-current-working-directory-to-your-docker-container-in-windows-74e47fa104d7
PWD = Path(__file__).parent.as_posix()

IMAGE = f"icr.io/qc-open-source-docs-public/preview@{IMAGE_DIGEST}"


Expand Down

0 comments on commit fbd0875

Please sign in to comment.