Update Docker.md (#1841)

* Ensure the **ONEDRIVE_DATA_DIR** folder exists before running the container
* Silence the stderr messages
This commit is contained in:
August Feng 2022-03-05 18:01:01 -05:00 committed by GitHub
parent c63b390f14
commit 7ff077efd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,13 +173,15 @@ docker run -it --restart unless-stopped --name onedrive_Work -v onedrive_conf_Wo
If you are experienced with docker and onedrive, you can use the following script:
```bash
# Update ONEDRIVE_DATA_DIR with correct existing OneDrive directory path
# Update ONEDRIVE_DATA_DIR with correct OneDrive directory path
ONEDRIVE_DATA_DIR="${HOME}/OneDrive"
# Create directory if non-existant
mkdir -p ${ONEDRIVE_DATA_DIR}
firstRun='-d'
docker pull driveone/onedrive:latest
docker inspect onedrive_conf > /dev/null || { docker volume create onedrive_conf; firstRun='-it'; }
docker inspect onedrive > /dev/null && docker rm -f onedrive
docker inspect onedrive_conf > /dev/null 2>&1 || { docker volume create onedrive_conf; firstRun='-it'; }
docker inspect onedrive > /dev/null 2>&1 && docker rm -f onedrive
docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/onedrive/conf -v "${ONEDRIVE_DATA_DIR}:/onedrive/data" driveone/onedrive:latest
```