Skip to content

Instantly share code, notes, and snippets.

@praul
Last active May 27, 2021 05:29
Show Gist options
  • Save praul/5234338823d61ac794e2fd95befc0b3d to your computer and use it in GitHub Desktop.
Save praul/5234338823d61ac794e2fd95befc0b3d to your computer and use it in GitHub Desktop.
Share files to filebrowser docker
#!/bin/bash
#These are two scripts to share and unshare files and folders to filebrowser, that runs in a docker container via docker-compose.
#It works across filesystems and users dockers own mount-binds.
#This image and the corresponding docker-compose.yml has been used: https://github.com/filebrowser/filebrowser
#Additionally you need yaml_cli from here: https://github.com/Gallore/yaml_cli
#See https://gist.github.com/praul/21d0b11aec5a0b71be8e406e9d7858f7#file-fbunshare-sh for unshare script
# Adjust path to docker-compose folder accordingly
# Usage: fbshare.sh <FILE OR FOLDER>
cd /docker/user/compose/filebrowser
f="$(basename -- $1)"
yaml_cli -f docker-compose.yml --list-append -s services:filebrowser:volumes $1:/data/singles/$f:ro
docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment