Docker client to sync files with containers


#1

Hello everyone,

I wanted to use files from my Seafile server within Docker containers.

I started looking for existing image featuring a Seafile client on Docker Hub. There are some, but with issues such as non-existant/vague documentation or improper tagging.

I don’t know if it’s something that people are looking for, but I made one. It’s available at flowgunso/seafile-client in Docker Hub.

Example usage with docker-compose and for the docker cli are provided. Essentially, it runs seaf-cli sync, but you have to pass to the container your Seafile server URL, your credentials and the library ID you want to sync with. Then you can share the path /volume as a volume to your containers for your own usages.

Feedback is welcome so I can keep improving it.

Quick infos

Docker Hub: flowgunso/seafile-client
Latest stable version: 1.2.0

Change log

[1.2.0] - 2019/05/02

  • Replace supervisord with cron for running the front job that keeps the container up. It uses less resources.
  • Improve the infinite-seaf-cli-start.sh into seafile-healthcheck.sh. The Seafile daemon will not be restarted if it’s state are either downloading or committing, which otherwise is problematic.

[1.1.2] - 2019/04/18

  • Slim down the Docker image, from 102MB to 67MB, gaining 35MB, reducing size by 34%.

[1.1.1] - 2019/04/18

  • Because of the infinite-seaf-cli-start loop, within the container was running many seaf-daemons. Now, the infinite loop stop the current seaf-daemon before starting it again. (see #3)

[1.1.0] - 2019/04/09

  • The container now actually use the UID/GID provided to it:
    The container entrypoint is run with root, then another entrypoint is run by the container’s user, seafuser, to run the Seafile client.

[1.0.6] - 2019/03/25

  • More minor fixes from v1.0.4

[1.0.5] - 2019/03/25

  • Minor fixes from v1.0.4

[1.0.4] - 2019/03/25

  • Fix the build target detection
  • Login to the Docker Hub from within the script, not the gitlab-ci.yml
  • Require Bash on all Gitlab CI stages
  • Add a script to push the README.md into the Docker Hub repository’s full_description

[1.0.3] - 2019/03/19

  • Restrict staging pipelines to pushed pipelines
  • Restrict production pipelines to pushed and triggered pipelines
  • Require a build target on triggered production pipelines

[1.0.2] - 2019/03/18

  • Fix a minor issue when testing for requested production build.

[1.0.1] - 2019/03/18

  • Add failsafe when importing Seafile’s APT-key
  • Restrict production build to latest, majors, minors and revisions version, on-demand.

[1.0.0] - 2019/03/15

  • Release to Docker Hub

[0.9.2] - 2019/03/15

  • Test release on GitLab, before Docker Hub

#2

Hi flow.gunso

I am not sure if you intended your docker container in use with Docker on OpenMediaVault but its there to use.
I have been trying to get it to work but as I have very little knowledge with Docker I’m unsure if I am implementing it correctly.

Have you gotten it to work with OpenMedaiVault?

One queston I have, is the SEAF_SERVER_URL suppose to have the port number after it eg: http://192.168.x.x:8000 or does the port number go elsewhere?

Thanks for hard work.


#3

I have gotten it to work!!

The seafile client docker in OpenMediaVault works and syncs!!

Woohoo


#4

Well, that’s perfect!

To answer you questions, this docker container is intended to work with others containers, so, yes, you can use it with Docker within OpenMediaVault, although I’ve not tried. But you did, so thank you for that.

About SEAF_SERVER_URL, it is supposed to be the same information you would use in the official Seafile clients. It’s actually used directly with seaf-cli, the Seafile command line interface. so the port number goes along with the address.


#5

Yes once I figured that out I got it to work.
Thanks for the info and putting together the container.


#6

Thank you for the container, it runs seamlessly.

One question though: is my understanding that in order to expose several libraries a new container must be used? Or is there a way to use several libraries with one container?


#7

You’re right, each library require it’s own container.

That being said, it could be implemented, without too much hassle.