Update docker.md

This commit is contained in:
Aleix Mariné-Tena 2025-10-07 13:20:50 +02:00 committed by GitHub
commit dde178ed9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -202,6 +202,63 @@ docker rm -f onedrive
## Advanced Usage
### Run OneDrive with custom CLI arguments.
Inside the Docker image, the entrypoint always starts the client with the arguments:
```
--confdir /onedrive/conf --syncdir /onedrive/data
```
If you want to add custom CLI arguments to the inner `onedrive` process of the container, you can do it like this or equivalently (notice `--other-custom-args` after the image name):
```
docker run \
-it \
--name onedrive \
--userns host \
-v ${ONEDRIVE_DIR}/conf:/onedrive/conf \
-v ${ONEDRIVE_DIR}/data:/onedrive/data \
-v ${ONEDRIVE_DIR}/logs:/onedrive/logs \
-l io.containers.autoupdate=image \
--restart unless-stopped \
--health-cmd "sh -c '[ -s /onedrive/conf/items.sqlite3-wal ]'" \
--health-interval 60s \
--health-retries 2 \
--health-timeout 5s \
docker.io/driveone/onedrive:latest \
--other-custom-args
```
> [!IMPORTANT]
> Command-line flags override anything in the config file, so if you set `sync_dir` in the config, it will be superseded by the CLI flag.
> Moreover, if you override the containers command and forget to include those arguments, the client will not have any information regarding the `sync_dir` and `conf_dir` location and thus it will fall back to `~/OneDrive` inside the container, which will look like it is “ignoring” your setting.
So, if you use custom CLI arguments on the inner Docker process, you are skipping the automated inclusion of arguments `--confdir /onedrive/conf --syncdir /onedrive/data`, so you will probably need to explicitly add them again to your `docker run` command. The previous example would look like this if you apply these best practices:
```
docker run \
-it \
--name onedrive \
--userns host \
-v ${ONEDRIVE_DIR}/conf:/onedrive/conf \
-v ${ONEDRIVE_DIR}/data:/onedrive/data \
-v ${ONEDRIVE_DIR}/logs:/onedrive/logs \
-l io.containers.autoupdate=image \
--restart unless-stopped \
--health-cmd "sh -c '[ -s /onedrive/conf/items.sqlite3-wal ]'" \
--health-interval 60s \
--health-retries 2 \
--health-timeout 5s \
docker.io/driveone/onedrive:latest \
--other-custom-args \
--sync-dir "/onedrive/data" \
--conf-dir "/onedrive/conf"
```
Notice the explicit inclusion of `--sync-dir "/onedrive/data"` `--conf-dir "/onedrive/conf"` after the image name.
### How to use Docker-compose
You can utilise `docker-compose` if available on your platform if you are able to use docker compose schemas > 3.
@ -432,4 +489,4 @@ RUN echo "ja_JP.UTF-8 UTF-8" > /etc/locale.gen && \
ENV LC_ALL ja_JP.UTF-8
```
The above example changes the Docker container to support Japanese. To support your local language, change `ja_JP.UTF-8` to the required entry.
The above example changes the Docker container to support Japanese. To support your local language, change `ja_JP.UTF-8` to the required entry.