Skip to content

Commit bd6cfdb

Browse files
committed
add: docker command related instructions for Windows users
1 parent 4b94adc commit bd6cfdb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,44 @@ Next, run the container:
5252
docker run -p 4000:4000 --rm -v $(pwd):/usr/src/app jekyll-site
5353
```
5454

55+
To run the `docker run` command on Windows, you need to adjust the syntax for the volume mapping (`-v`) as Windows uses different path formats. Here's how to run your command on Windows:
56+
57+
### Steps for Windows:
58+
1. **Check Docker Installation**: Ensure Docker is installed and running.
59+
2. **Adjust Path for Volume Mapping**:
60+
- On Windows, replace `$(pwd)` with the full absolute path to your current directory. For example:
61+
```bash
62+
-v C:\path\to\your\site:/usr/src/app
63+
```
64+
65+
### Full Command Example:
66+
```bash
67+
docker run -p 4000:4000 --rm -v C:\path\to\your\site:/usr/src/app jekyll-site
68+
```
69+
70+
### Things to Keep in Mind:
71+
1. **Use PowerShell?**:
72+
- If you are using PowerShell, you can use `${PWD}` for the current directory:
73+
```bash
74+
docker run -p 4000:4000 --rm -v ${PWD}:/usr/src/app jekyll-site
75+
```
76+
77+
2. **Enable Docker File Sharing**:
78+
- If your volume doesn't map correctly, ensure Docker has access to the drive where your project resides. To do this:
79+
- Open Docker Desktop.
80+
- Go to *Settings**Resources**File Sharing*.
81+
- Add your drive (e.g., `C:`).
82+
83+
3. **Run in Command Prompt or PowerShell**:
84+
- In *Command Prompt*:
85+
```bash
86+
docker run -p 4000:4000 --rm -v C:\path\to\your\site:/usr/src/app jekyll-site
87+
```
88+
- In *PowerShell*:
89+
```bash
90+
docker run -p 4000:4000 --rm -v ${PWD}:/usr/src/app jekyll-site
91+
```
92+
5593
# Maintenance
5694

5795
Bug reports and feature requests to the template should be [submitted via GitHub](https://github.com/academicpages/academicpages.github.io/issues/new/choose). For questions concerning how to style the template, please feel free to start a [new discussion on GitHub](https://github.com/academicpages/academicpages.github.io/discussions).

0 commit comments

Comments
 (0)