add dropbox

This commit is contained in:
Newnius 2018-11-14 11:07:37 +08:00
parent f09bb24fa3
commit a2d71a8605
2 changed files with 59 additions and 0 deletions

13
dropbox/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM python:3.7-slim-stretch
MAINTAINER Newnius <newnius.cn@gmail.com>
WORKDIR /root
RUN apt-get update \
&& apt-get install -y wget \
&& wget -O dropbox.tgz "https://www.dropbox.com/download?plat=lnx.x86_64" \
&& tar xzf dropbox.tgz \
&& rm dropbox.tgz
ENTRYPOINT ["/root/.dropbox-dist/dropboxd"]

46
dropbox/README.md Normal file
View File

@ -0,0 +1,46 @@
# Run Dropbox in docker
Run Dropbox in docker containers.
Even if the container exits, the session will still exist.
## Deploy
#### normal
#### k8s
#### swarm
```bash
docker service create \
--name dropbox \
--hostname dropbox \
--replicas 1 \
--detach=true \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--mount type=bind,source=/home/dropbox/.dropbox,target=/root/.dropbox \
--mount type=bind,source=/data/,target=/root/Dropbox \
newnius/dropbox
```
## Login
Run following command
```bash
docker ps | grep dropbox | cut -f1 -d" " | xargs docker logs --tail 5
```
until you will see outputs like
```
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=01010101010101010101010101010101 to link this device.
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=01010101010101010101010101010101 to link this device.
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=01010101010101010101010101010101 to link this device.
```
Visit the url to link your account.