Docker - Make --verbose optional based on environment variable (#651)

* Add environment variables section into relevant document
* Update entrypoint.sh to support --verbose via environment variable
This commit is contained in:
Jon Mills 2019-09-09 11:44:07 +08:00 committed by abraunegg
parent 42d8c454e2
commit 230be5a23d
2 changed files with 19 additions and 1 deletions

View file

@ -26,7 +26,15 @@ fi
chown "${oduser}:${odgroup}" /onedrive/ /onedrive/conf
# Default parameters
ARGS=(--monitor --verbose --confdir /onedrive/conf --syncdir /onedrive/data)
ARGS=(--monitor --confdir /onedrive/conf --syncdir /onedrive/data)
#Make Verbose output optional, based on an environment variable
# default behaviour is verbose (to continue to behave as before)
if ! [ "${ONEDRIVE_VERBOSE:=1}" == "0" ]; then
echo "# We are being verbose"
echo "# set ONEDRIVE_VERBOSE environment to 0 (Zero) to be less chatty"
ARGS=(--verbose ${ARGS[@]})
fi
if [ ${#} -gt 0 ]; then
ARGS=("${@}")

View file

@ -116,6 +116,16 @@ docker inspect onedrive > /dev/null && docker rm -f onedrive
docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/onedrive/conf -v "${onedriveDir}:/onedrive/data" driveone/onedrive
```
## Environment Variables
| Variable | Purpose | Sample Value |
| ---------------- | --------------------------------------------------- |:-------------:|
| <B>ONEDRIVE_UID</B> | UserID (UID) to run as | 1000 |
| <B>ONEDRIVE_GID</B> | GroupID (GID) to run as | 1000 |
| <B>ONEDRIVE_VERBOSE</B> | Controls "verbose" switch on onedrive sync. Default (i.e. not set or non-zero value) behaviour is to continue to be verbose as before | 0 |
## Build instructions
You can also build your own image instead of pulling the one from dockerhub:
```bash