Skip to content

Instantly share code, notes, and snippets.

@i026e
Last active March 2, 2017 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save i026e/b135eadd6149956d1e979f9c83beb84c to your computer and use it in GitHub Desktop.
Save i026e/b135eadd6149956d1e979f9c83beb84c to your computer and use it in GitHub Desktop.
Runnig dropbox inside docker container
#!/usr/bin/env bash
##https://hub.docker.com/r/janeczku/dropbox/
#Modify this
DROPBOX_FOLDER="${HOME}/Dropbox"
MEMORY_LIMIT="300m"
CONTAINER="dropbox"
DROPBOX_UID=${UID} #1000
DROPBOX_GID=${GROUPS} #1000
function install {
docker run -d --restart=always \
--name=${CONTAINER} \
--net="host" \
--memory=${MEMORY_LIMIT} \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ${DROPBOX_FOLDER}:/dbox/Dropbox \
-v "${HOME}/.dropbox":/dbox/.dropbox \
-e XAUTHORITY=${XAUTHORITY} \
-e DISPLAY=unix${DISPLAY} \
-e DBOX_UID=${DROPBOX_UID} \
-e DBOX_GID=${DROPBOX_GID} \
janeczku/dropbox
docker exec -t -i ${CONTAINER} /usr/bin/apt-get -qqy update
docker exec -t -i ${CONTAINER} /usr/bin/apt-get -qqy install libxxf86vm1 libxslt1.1 libqt5gui5
}
case $1 in
install)
install
;;
remove)
docker stop ${CONTAINER}
docker rm ${CONTAINER}
;;
log)
#Check the logs of the container to get URL to authenticate with your Dropbox account
docker logs ${CONTAINER}
;;
bash)
docker exec -t -i ${CONTAINER} /bin/bash
;;
start)
docker start ${CONTAINER}
;;
stop)
docker stop ${CONTAINER}
;;
*)
#send command to dropbox
docker exec -t -i ${CONTAINER} dropbox ${@}
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment