I would like to run Dropbox inside Docker container. This way I could sync data with docker by uploading it to Dropbox. And also maintain data backup, that will be useful when running new versions of docker images.
Created this simple Dockerfile
FROM phusion/baseimage:0.9.15
#Install wget
RUN apt-get update && \
apt-get -f install && \
apt-get install -y wget
#Install Dropbox
RUN mkdir /usr/local/dropbox && \
cd /usr/local/dropbox && \
wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
RUN mkdir /etc/service/dropbox
ADD ./dropbox.sh /etc/service/dropbox/run
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
And service file dropbox.sh
#!/bin/sh
exec /usr/local/dropbox/.dropbox-dist/dropboxd
After building and running Docker image, Dropbox says: This computer isn't linked to any Dropbox account...
and provides link to associate Dropbox account with current computer. After linking, I see a welcome message and data is syncyd inside /root/Dropbox folder.
I commit docker changes
sudo docker commit `sudo docker ps -l -q` imagename
But when killing docker container and running it again Dropbox insists: This computer isn't linked to any Dropbox account...
I confirm that inside container, folder /root/Dropbox exists, and data is there, synced during previous container execution. But my container lost link to Dropbox, and needs to be linked again.
What am I missing? How to persist Dropbox-Docker_container link between container executions?