From a2d71a8605da5211667fd5fa21af68de80125a5f Mon Sep 17 00:00:00 2001 From: Newnius Date: Wed, 14 Nov 2018 11:07:37 +0800 Subject: [PATCH] add dropbox --- dropbox/Dockerfile | 13 +++++++++++++ dropbox/README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 dropbox/Dockerfile create mode 100644 dropbox/README.md diff --git a/dropbox/Dockerfile b/dropbox/Dockerfile new file mode 100644 index 0000000..cc5979c --- /dev/null +++ b/dropbox/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.7-slim-stretch + +MAINTAINER Newnius + +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"] diff --git a/dropbox/README.md b/dropbox/README.md new file mode 100644 index 0000000..fb68d1a --- /dev/null +++ b/dropbox/README.md @@ -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.