From 7ff077efd8b937b86ea0817acc84ed70ffa8d72e Mon Sep 17 00:00:00 2001 From: August Feng <46177585+augustfengd@users.noreply.github.com> Date: Sat, 5 Mar 2022 18:01:01 -0500 Subject: [PATCH] Update Docker.md (#1841) * Ensure the **ONEDRIVE_DATA_DIR** folder exists before running the container * Silence the stderr messages --- docs/Docker.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/Docker.md b/docs/Docker.md index 3658e6ac..aead3079 100644 --- a/docs/Docker.md +++ b/docs/Docker.md @@ -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 ```