Linux Notes: Fixing Dropbox Container: Update 2

Dropbox

I recently updated the way I run Dropbox in a container on CentOS 7. For a history of this process within my environment, see the following articles:

Putting Dropbox in a container is required for installations of Linux that do not use the latest version of the C libraries and other bits. It is also convenient for keeping Dropbox to itself.

The major change is the need to include more libraries than those in the original container by Jan Broer. The steps are the same as the ones I took in my article Fixing the Dropbox Container. Following are the results of those changes. I also added a Makefile to the mix. I prefer those, as I can just type “make” and not the long command to build the Docker image. As testing occurs, a rebuild may be required.

The Patch

Below is the patch you can use to adopt the latest changes needed to run a headless Dropbox on CentOS, per the Dropbox Forums. This also includes the previous patch so that no fixes are lost.

diff -c -b docker-dropbox-master/Dockerfile docker-dropbox-master.elh/Dockerfile
*** docker-dropbox-master/Dockerfile 2016-10-03 13:22:27.000000000 -0500
— docker-dropbox-master.elh/Dockerfile 2020-04-15 09:01:21.279695074 -0500
***************
*** 4,13 ****

# Following ‘How do I add or remove Dropbox from my Linux repository?’ – https://www.dropbox.com/en/help/246
RUN echo ‘deb http://linux.dropbox.com/debian jessie main’ > /etc/apt/sources.list.d/dropbox.list \
! && apt-key adv –keyserver pgp.mit.edu –recv-keys 1C61A2656FB57B7E4DE0F4C1FC918B335044912E \
&& apt-get -qqy update \
# Note ‘ca-certificates’ dependency is required for ‘dropbox start -i’ to succeed
! && apt-get -qqy install ca-certificates curl python-gpgme dropbox \
# Perform image clean up.
&& apt-get -qqy autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
— 4,13 —-

# Following ‘How do I add or remove Dropbox from my Linux repository?’ – https://www.dropbox.com/en/help/246
RUN echo ‘deb http://linux.dropbox.com/debian jessie main’ > /etc/apt/sources.list.d/dropbox.list \
! && apt-key adv –keyserver hkp://pool.sks-keyservers.net:80 –recv-keys 1C61A2656FB57B7E4DE0F4C1FC918B335044912E \
&& apt-get -qqy update \
# Note ‘ca-certificates’ dependency is required for ‘dropbox start -i’ to succeed
! && apt-get -qqy install ca-certificates curl python-gpgme libc6 libglapi-mesa libxdamage1 libxfixes3 libxcb-glx0 libxcb-dri2-0 libxcb-dri3-0 libxcb-present0 libxcb-sync1 libxshmfence1 libxxf86vm1 dropbox \
# Perform image clean up.
&& apt-get -qqy autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
***************
*** 38,43 ****
— 38,44 —-
&& chmod u-w /dbox \
&& chmod o-w /tmp \
&& chmod g-w /tmp \
+ && chmod 755 /opt/dropbox/dropbox-lnx.*/libdropbox_apex.so \
# Prepare for command line wrapper
&& mv /usr/bin/dropbox /usr/bin/dropbox-cli

Only in docker-dropbox-master.elh/: Makefile
diff -c -b docker-dropbox-master/run docker-dropbox-master.elh/run
*** docker-dropbox-master/run 2016-10-03 13:22:27.000000000 -0500
— docker-dropbox-master.elh/run 2019-10-19 00:46:37.189111692 -0500
***************
*** 64,69 ****
— 64,71 —-
fi
fi

+ chmod 755 /opt/dropbox/libdropbox_apex.so
+
echo “Starting dropboxd ($(cat /opt/dropbox/VERSION))…”
umask 002
exec su dropbox -s /bin/bash -c /opt/dropbox/dropboxd

Conclusion

I use Dropbox often to transfer files, and having it available on my Linux system is a must. Once I applied this patch, Dropbox started to work again. However, if you do this, be careful. When Dropbox crashes, it fills up your Dropbox storage with core files. Without this patch, core files will abound. You will want to delete them to save your Dropbox space!

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *

I accept the Privacy Policy

This site uses Akismet to reduce spam. Learn how your comment data is processed.