fix format issues in docker/readme.md

This commit is contained in:
Cauly Kan 2019-01-23 09:20:52 +08:00
parent 14c36d6c91
commit 1172432390

View file

@ -6,13 +6,14 @@ This container offers simple monitoring-mode service for 'Free Client for OneDri
## Usage instructions ## Usage instructions
### 0. Install the docker under your own platform's instructions ### 0. Install the docker under your own platform's instructions
### 1. Pull the image ### 1. Pull the image
```bash ```bash
docker pull driveone/onedrive docker pull driveone/onedrive
``` ```
**NOTE:** SELinux context needs to be configured or disabled for Docker, to be able to write to OneDrive host directory. **NOTE:** SELinux context needs to be configured or disabled for Docker, to be able to write to OneDrive host directory.
### 2. Prepare required stuff ### 2. Prepare required stuff
@ -20,6 +21,7 @@ docker pull driveone/onedrive
Onedrive needs two volumes. One of them is the config volume. Onedrive needs two volumes. One of them is the config volume.
If you dont't need an extra config file, You can create a docker volume: If you dont't need an extra config file, You can create a docker volume:
```bash ```bash
docker volume create onedrive_conf; docker volume create onedrive_conf;
``` ```
@ -28,9 +30,10 @@ This will create a docker volume labeled 'onedrive_conf', which we will use it l
The second one is your data folder that needs to sync with. Keep in mind that: The second one is your data folder that needs to sync with. Keep in mind that:
- The owner of the folder must not be root - The owner of the folder must not be root
- The owner have permission to its parent directory
(because onedrive will try to setup a monitor for the sync folder). - The owner have permission to its parent directory
(because onedrive will try to setup a monitor for the sync folder).
### 3. First run ### 3. First run
@ -38,41 +41,47 @@ Onedrive also needs to be authorized with your account.
This is done by running docker in interactive mode. This is done by running docker in interactive mode.
**make sure to change onedriveDir to your own.** **make sure to change onedriveDir to your own.**
```bash ```bash
onedriveDir="${HOME}/OneDrive" onedriveDir="${HOME}/OneDrive"
docker run -it --restart unless-stopped --name onedrive -v onedrive_conf:/onedrive/conf -v "${onedriveDir}:/onedrive/data" driveone/onedrive docker run -it --restart unless-stopped --name onedrive -v onedrive_conf:/onedrive/conf -v "${onedriveDir}:/onedrive/data" driveone/onedrive
``` ```
- You will be asked to open a specific link using your web browser - You will be asked to open a specific link using your web browser
- login into your Microsoft Account and give the application the permission - login into your Microsoft Account and give the application the permission
- After giving the permission, you will be redirected to a blank page. - After giving the permission, you will be redirected to a blank page.
- Copy the URI of the blank page into the application. - Copy the URI of the blank page into the application.
If your onedrive is working as expected, you can detach from the container with Ctrl+p, Ctrl+q. If your onedrive is working as expected, you can detach from the container with Ctrl+p, Ctrl+q.
### 4. Status, stop, and restart ### 4. Status, stop, and restart
Check if monitor service is running Check if monitor service is running
```bash ```bash
docker ps -f name=onedrive docker ps -f name=onedrive
``` ```
Show monitor run logs Show monitor run logs
```bash ```bash
docker logs onedrive docker logs onedrive
``` ```
Stop running monitor Stop running monitor
```bash ```bash
docker stop onedrive docker stop onedrive
``` ```
Resume monitor Resume monitor
```bash ```bash
docker start onedrive docker start onedrive
``` ```
Unregister onedrive monitor Unregister onedrive monitor
```bash ```bash
docker rm -f onedrive docker rm -f onedrive
``` ```
@ -81,7 +90,7 @@ docker rm -f onedrive
Onedrive should run in default configuration, but however you can change your configuration. Onedrive should run in default configuration, but however you can change your configuration.
First download the default config from [here](https://raw.githubusercontent.com/abraunegg/onedrive/master/config) First download the default config from [here](https://raw.githubusercontent.com/abraunegg/onedrive/master/config)
Then put it into your onedrive_conf volume: `/var/lib/docker/volumes/onedrive_conf/_data` Then put it into your onedrive_conf volume: `/var/lib/docker/volumes/onedrive_conf/_data`
Or you can map your own config folder to config volume (copy stuffs from docker volume first) Or you can map your own config folder to config volume (copy stuffs from docker volume first)
@ -89,7 +98,9 @@ Or you can map your own config folder to config volume (copy stuffs from docker
The detailed document for the config can be found here: [additional-configuration](https://github.com/abraunegg/onedrive#additional-configuration) The detailed document for the config can be found here: [additional-configuration](https://github.com/abraunegg/onedrive#additional-configuration)
## Run or update with one script ## Run or update with one script
If you are experienced with docker and onedrive, you can use the following script: If you are experienced with docker and onedrive, you can use the following script:
```bash ```bash
# Update onedriveDir with correct existing OneDrive directory path # Update onedriveDir with correct existing OneDrive directory path
onedriveDir="${HOME}/OneDrive" onedriveDir="${HOME}/OneDrive"
@ -102,6 +113,7 @@ docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/
``` ```
## Build instructions ## Build instructions
```bash ```bash
git clone https://github.com/abraunegg/onedrive git clone https://github.com/abraunegg/onedrive
cd onedrive cd onedrive