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

Need to correct commands for Windows users (PowerShell) in 06_bind_mounts.md #17369

Merged
merged 2 commits into from May 19, 2023
Merged

Conversation

hotenov
Copy link
Contributor

@hotenov hotenov commented May 19, 2023

Proposed changes

Current version of command does not work on Windows (PowerShell)

docker run -it --mount type=bind,src="$(pwd)",target=/src ubuntu bash

on page https://docs.docker.com/get-started/06_bind_mounts/#trying-out-bind-mounts

and this

docker run -dp 3000:3000 `
    -w /app --mount type=bind,src="$(pwd)",target=/app `
    node:18-alpine `
    sh -c "yarn install && yarn run dev"

in section https://docs.docker.com/get-started/06_bind_mounts/#run-your-app-in-a-development-container

error in PowerShell shell

invalid argument "type=bind,src=\"$(pwd)\",target=/src" for "--mount" flag: parse error on line 1, column 15: bare " in non-quoted-field

Need to add caveat (note) for Windows users, that they should try this:

docker run -it --mount "type=bind,src=$pwd,target=/src" ubuntu bash

ATTENTION: This command does NOT work in bash shell (Linux). I pushed the second commit adding appropriate note about that (I copied it from text below).

Related issues (optional)

Closes #17370

@netlify
Copy link

netlify bot commented May 19, 2023

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 52a9ce3
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/646734587d4eb60008e9e862
😎 Deploy Preview https://deploy-preview-17369--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@hotenov hotenov changed the title Correct quoting in PowerShell command in 06_bind_mounts.md Need to add correct command for Windows users (PowerShell) in 06_bind_mounts.md May 19, 2023
@hotenov hotenov changed the title Need to add correct command for Windows users (PowerShell) in 06_bind_mounts.md Need to correct commands for Windows users (PowerShell) in 06_bind_mounts.md May 19, 2023
Copy link
Contributor

@craig-osterhout craig-osterhout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM

@craig-osterhout craig-osterhout merged commit d4d21db into docker:main May 19, 2023
9 checks passed
@hotenov hotenov deleted the patch-1 branch May 20, 2023 08:58
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

Successfully merging this pull request may close these issues.

Two commands with pwd variable does not work for Windows users (PowerShell) in 06_bind_mounts.md
2 participants