Skip to content

Instantly share code, notes, and snippets.

@chbrandt
Created October 6, 2021 08:47
Show Gist options
  • Save chbrandt/275e999a0b45c249d121b4b75d6a6960 to your computer and use it in GitHub Desktop.
Save chbrandt/275e999a0b45c249d121b4b75d6a6960 to your computer and use it in GitHub Desktop.
OneDrive docker container script
#!/bin/bash
# Use docker container from https://github.com/abraunegg/onedrive
# Detailed instructions at https://github.com/abraunegg/onedrive/blob/master/docs/Docker.md
ONEDRIVE_DATA_DIR="${HOME}/OneDrive"
ONEDRIVE_UID=`id -u`
ONEDRIVE_GID=`id -g`
mkdir -p ${ONEDRIVE_DATA_DIR} &> /dev/null
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 run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/onedrive/conf \
-v "${ONEDRIVE_DATA_DIR}:/onedrive/data" \
-e "ONEDRIVE_UID:${ONEDRIVE_UID}" \
-e "ONEDRIVE_GID:${ONEDRIVE_GID}" \
driveone/onedrive:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment