mirror of https://github.com/docker/docs.git
Need to correct commands for Windows users (PowerShell) in 06_bind_mounts.md (#17369)
* Correct quoting in PowerShell command in 06_bind_mounts.md * Add and correct commands that use pwd variable for Windows users
This commit is contained in:
parent
b902e96ba5
commit
d4d21dbda8
|
@ -50,10 +50,18 @@ command prompt (`cmd`).
|
|||
2. Run the following command to start `bash` in an `ubuntu` container with a
|
||||
bind mount.
|
||||
|
||||
If you are using an Mac or Linux device, then use the following command.
|
||||
|
||||
```console
|
||||
$ docker run -it --mount type=bind,src="$(pwd)",target=/src ubuntu bash
|
||||
```
|
||||
|
||||
If you are using Windows, then use the following command in PowerShell.
|
||||
|
||||
```powershell
|
||||
$ docker run -it --mount "type=bind,src=$pwd,target=/src" ubuntu bash
|
||||
```
|
||||
|
||||
The `--mount` option tells Docker to create a bind mount, where `src` is the
|
||||
current working directory on your host machine (`getting-started/app`), and
|
||||
`target` is where that directory should appear inside the container (`/src`).
|
||||
|
@ -138,7 +146,7 @@ So, let's do it!
|
|||
|
||||
```powershell
|
||||
$ docker run -dp 3000:3000 `
|
||||
-w /app --mount type=bind,src="$(pwd)",target=/app `
|
||||
-w /app --mount "type=bind,src=$pwd,target=/app" `
|
||||
node:18-alpine `
|
||||
sh -c "yarn install && yarn run dev"
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue