Merge pull request #15 from docker/qualify-pwd

Add curly brackets around $PWD usage to fix powershell issues
This commit is contained in:
Michael Irwin 2020-04-15 10:37:33 -04:00 committed by GitHub
commit e81c911115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -169,7 +169,7 @@ With all of that explained, let's start our dev-ready container!
```bash hl_lines="3 4 5 6 7" ```bash hl_lines="3 4 5 6 7"
docker run -dp 3000:3000 \ docker run -dp 3000:3000 \
-w /app -v $PWD:/app \ -w /app -v ${PWD}:/app \
--network todo-app \ --network todo-app \
-e MYSQL_HOST=mysql \ -e MYSQL_HOST=mysql \
-e MYSQL_USER=root \ -e MYSQL_USER=root \

View File

@ -40,7 +40,7 @@ So, let's do it!
```bash ```bash
docker run -dp 3000:3000 \ docker run -dp 3000:3000 \
-w /app -v $PWD:/app \ -w /app -v ${PWD}:/app \
node:12-alpine \ node:12-alpine \
sh -c "yarn install && yarn run dev" sh -c "yarn install && yarn run dev"
``` ```

View File

@ -53,7 +53,7 @@ To remember, this was the command we were using to define our app container.
```bash ```bash
docker run -dp 3000:3000 \ docker run -dp 3000:3000 \
-w /app -v $PWD:/app \ -w /app -v ${PWD}:/app \
--network todo-app \ --network todo-app \
-e MYSQL_HOST=mysql \ -e MYSQL_HOST=mysql \
-e MYSQL_USER=root \ -e MYSQL_USER=root \
@ -102,7 +102,7 @@ docker run -dp 3000:3000 \
- 3000:3000 - 3000:3000
``` ```
1. Next, we'll migrate both the working directory (`-w /app`) and the volume mapping (`-v $PWD:/app`) by using 1. Next, we'll migrate both the working directory (`-w /app`) and the volume mapping (`-v ${PWD}:/app`) by using
the `working_dir` and `volumes` definitions. Volumes also has a [short](https://docs.docker.com/compose/compose-file/#short-syntax-3) and [long](https://docs.docker.com/compose/compose-file/#long-syntax-3) syntax. the `working_dir` and `volumes` definitions. Volumes also has a [short](https://docs.docker.com/compose/compose-file/#short-syntax-3) and [long](https://docs.docker.com/compose/compose-file/#long-syntax-3) syntax.
One advantage of Docker Compose volume definitions is we can use relative paths from the current directory. One advantage of Docker Compose volume definitions is we can use relative paths from the current directory.