Update index.md

I was following the tutorial using "Docker Desktop for Windows" and received the following exception on execution of the "docker run..." command:

docker run -dp 3000:3000 -w /app -v "$(pwd):/app" node:12-alpine sh -c "yarn install && yarn run dev"

docker: Error response from daemon: status code not OK but 500:     ����          FDocker.Core, Version=3.0.0.50646, Culture=neutral, PublicKeyToken=null  ocker.Core.DockerException  WatsonBuckets  System.Collections.IDictionarySystem.Excepti     ocker.Core.DockerException   Filesharing has been cancelled

Adding the base-path as a shared resource to the docker configuration solved the problem.
This commit is contained in:
workaholic-gh 2020-12-27 19:35:46 +01:00 committed by GitHub
parent 3de6451f5c
commit a565acabab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,3 @@
In the previous chapter, we talked about and used a **named volume** to persist the data in our database.
Named volumes are great if we simply want to store data, as we don't have to worry about _where_ the data
is stored.
@ -100,6 +99,20 @@ all of the build tools and environments installed. With a single `docker run` co
to go. We'll talk about Docker Compose in a future step, as this will help simplify our commands (we're already getting a lot
of flags).
### Optionals steps for "resource sharing" may be required
If the `docker run...` command above fails with an error message, stating `docker: Error response form daemon: status code not OK but 500:...`, it's likely caused by the fact, that resource sharing is disabled (e.g. default in "Docker Desktop for Windows").
To make it work, you need to add a path to the "Docker Desktop" configuration, to define it as a shared ressource between the host and docker containers.
1. Click the "gear" symbol inside the docker dashboard, to open the "Settings" panel.
1. Click "Resources"
1. Click "FILE SHARING"
1. Click on blue "plus" symbol
1. Enter the path to the shared folder
1. Click on "Apply & Restart"
***Please note:** If the path name is automatically shortened, you need to make sure it's still valid. In most cases you'll need to manually reduce the path name to the directory on the higher level.*
## Recap
At this point, we can persist our database and respond rapidly to the needs and demands of our investors and founders. Hooray!