This commit is contained in:
rtisma
2020-02-15 11:59:04 -05:00
commit b675b7baf1
4 changed files with 89 additions and 0 deletions

4
.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
Dockerfile
docker-compose.yml
README.md
mediafire-data/

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM ubuntu:14.04
ENV MEDIAFIRE_FUSE_VERSION 0.90
WORKDIR /srv
RUN apt update \
&& apt install -y git cmake build-essential libjansson-dev libcurl4-openssl-dev libfuse-dev libssl-dev
RUN git clone https://github.com/MediaFire/mediafire-fuse \
&& cd mediafire-fuse \
&& git checkout $MEDIAFIRE_FUSE_VERSION \
&& mkdir -p build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
&& mkdir -p /mediafire/data
CMD mediafire-fuse -u $MEDIAFIRE_USERNAME -p $MEDIAFIRE_PASSWORD /mediafire/data \
&& FOR_100_YEARS=$((100*365*24*60*60));while true;do sleep $FOR_100_YEARS;done

52
README.md Normal file
View File

@@ -0,0 +1,52 @@
mediafire-fuse for Docker
---
# Descrition
Since mediafire-fuse was not easy to install on Manjaro, I created this "sandbox" environment to help with downloading many large files to my local machine (or docker host).
# Requirements
- docker
- docker-compose
# Usage
## Running
1. Build and run in one step
```bash
MEDIAFIRE_USERNAME=<username> MEDIAFIRE_PASSWORD=<password> docker-compose up --build -d
```
## Downloading
1. Login to the container
```bash
docker-compose exec mediafire-fuse bash
```
2. Copy the files you want from `/mediafire/data` (the fuse mount) to `/mediafire/host` (the mount to the docker host directory)
```bash
cp -r /mediafire/data/<some_file_or_folder> /mediafire/host
```
Then on the docker host, you will see the copied files/directories in `./mediafire-data`
## Uploading
1. Copy the files you want to `./mediafire-data` on the docker host
2. Login to the container
```bash
docker-compose exec mediafire-fuse bash
```
3. Copy the files you want to upload to mediafire from `/mediafire/host` (the mount to the docker host directory) to the `/mediafire/data/` (the mediafire fuse mount point)
```bash
cp -r /mediafire/host/<some_file_or_folder> /mediafire/data
```
## Stop service
```bash
docker-compose down -v
```

12
docker-compose.yml Normal file
View File

@@ -0,0 +1,12 @@
version: '3.7'
services:
mediafire-fuse:
build:
context: ./
dockerfile: Dockerfile
privileged: true
environment:
MEDIAFIRE_USERNAME: "$MEDIAFIRE_USERNAME"
MEDIAFIRE_PASSWORD: "$MEDIAFIRE_PASSWORD"
volumes:
- "./mediafire-data:/mediafire/host"