Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hvalev/mergerfs-docker into…
Browse files Browse the repository at this point in the history
… main
  • Loading branch information
hvalev committed Jul 19, 2021
2 parents b08af90 + 10ff184 commit 848fb45
Showing 1 changed file with 36 additions and 22 deletions.
58 changes: 36 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
# mergerfs
# mergerfs-docker
[![build](https://github.com/hvalev/mergerfs-docker/actions/workflows/build.yml/badge.svg)](https://github.com/hvalev/mergerfs-docker/actions/workflows/build.yml)
![Shiny%20version](https://img.shields.io/badge/mergerfs%20version-2.32.5-green)
![Docker Pulls](https://img.shields.io/docker/pulls/hvalev/mergerfs-docker)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/hvalev/mergerfs-docker)

All credit for the file-system itself to trapexit/mergerfs.
All credit goes to [trapexit/mergerfs](https://github.com/trapexit/mergerfs).

## Usage
## Motivation
If you are here, then you are most likely looking for a simple solution to fuse files and folders on multiple hard drives to a single mountpoint. What I could not find, however, was a simple and regularly updated docker container which simply takes input volumes and merges them to a predefined path. This repository attempts to do just that.

Image is available at:
```
docker.io/ojford/mergerfs
ghcr.io/ojford/mergerfs
```
As you will see below, you just need to mount all drives you wish to merge to ```/disks``` and they will appear as one drive under ```/merged```. It is important that for the merged volume, you add the ```:shared``` bind to expose the containers' merged path to the host. To adjust the path where the merged drives would appear on the host, simply change the ```/mnt/merged``` path to one of your choice. That's it!

With tags in the form:
```
latest
<mergerfs-version>
<mergerfs-version>-<this-repo-release-number>
```

Paths to pool should be mounted in directories within:
## How to run it
Docker run:
```
/mnt/bricksets/
docker run -v /mnt/nd1:/disks/nd1 -v /mnt/nd2:/disks/nd2 -v /mnt/nd3:/disks/nd3 -v /mnt/merged:/merged:shared --device /dev/fuse --cap-add SYS_ADMIN -d hvalev/mergerfs-docker
```

For each directory there, a pool of the same name will be mounted within:
docker-compose:
```
/mnt/pools/
version: "3.8"
services:
mergerfs:
image: hvalev/mergerfs-docker:latest
container_name: mergerfs
cap_add:
- SYS_ADMIN
devices:
- /dev/fuse:/dev/fuse
volumes:
- /mnt/nd1:/disks/nd1
- /mnt/nd2:/disks/nd2
- /mnt/nd3:/disks/nd3
- /mnt/merged:/merged:shared
restart: always
```

`fusermount -u` is *not* run automatically.
## Customizing
* If you would like to customize the mergerfs command with additional options, you can overwrite entrypoint.sh by mounting your own using an additional volume mount.
* If you would like to combine this with samba to share it over the network, you could also use a samba docker container.

## Acknowledgements
The following resources have been extremely helpful:
* https://hub.docker.com/r/ojford/mergerfs
* https://perfectmediaserver.com/tech-stack/mergerfs.html
* https://github.com/homespirit/mergerfs-docker

Override settings, if required, with either a different command, or with [runtime config](/trapexit/mergerfs#runtime-config)

## Licence

mergerfs itself has the following licence:
```
/*
Expand Down

0 comments on commit 848fb45

Please sign in to comment.