diff --git a/docs/tutorial/using-bind-mounts/index.md b/docs/tutorial/using-bind-mounts/index.md index 3aceb6c51..5c6301716 100644 --- a/docs/tutorial/using-bind-mounts/index.md +++ b/docs/tutorial/using-bind-mounts/index.md @@ -36,11 +36,11 @@ So, let's do it! 1. Make sure you don't have any previous `getting-started` containers running. -1. Run the following command from the source code folder. We'll explain what's going on afterwards: +1. Make sure you are in the root directory of the source code, i.e. `getting-started`, and run the following command. We'll explain what's going on afterwards: ```bash docker run -dp 3000:3000 \ - -w /app -v "$(pwd):/app" \ + -w /app -v "$(pwd)/app:/app" \ node:12-alpine \ sh -c "yarn install && yarn run dev" ``` @@ -49,14 +49,14 @@ So, let's do it! ```powershell docker run -dp 3000:3000 ` - -w /app -v "$(pwd):/app" ` + -w /app -v "$(pwd)/app:/app" ` node:12-alpine ` sh -c "yarn install && yarn run dev" ``` - `-dp 3000:3000` - same as before. Run in detached (background) mode and create a port mapping - `-w /app` - sets the container's present working directory where the command will run from - - `-v "$(pwd):/app"` - bind mount (link) the host's present working directory to the container's `/app` directory + - `-v "$(pwd)/app:/app"` - bind mount (link) the host's present `getting-started/app` directory to the container's `/app` directory. Note: Docker requires absolute paths for binding mounts, so in this example we use `pwd` for printing the absolute path of the working directory, i.e. the source code's root directory, instead of typing it manually - `node:12-alpine` - the image to use. Note that this is the base image for our app from the Dockerfile - `sh -c "yarn install && yarn run dev"` - the command. We're starting a shell using `sh` (alpine doesn't have `bash`) and running `yarn install` to install _all_ dependencies and then running `yarn run dev`. If we look in the `package.json`,