Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker workflow #70

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM gcc

RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
fuse \
libfuse-dev \
libtorrent-rasterbar-dev \
libcurl4-openssl-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY . /src/btfs/
WORKDIR /src/btfs/

RUN \
autoreconf -fvi && \
./configure

RUN \
make && \
make install

ENTRYPOINT [ "btfs", "-f" ]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,13 @@ Use [`brew`](https://brew.sh) to get the dependencies.
And optionally, if you want to install it:

$ make install

## Building and running with Docker
Both `Dockerfile` and Docker Compose [manifest](./docker-compose.yml) are provided. They can be used both for deploying and for development (no need to install development toolchain in your machine, just Docker and Docker Compose).
You can use them to build and run from source a container which will mount [Sintel](https://cloud.blender.org/films/sintel) movie torrent in your `/tmp/btfs-docker/` dir by doing:
```
$ docker-compose up --build --force-recreate
```
Stop it by `CTRL+C`'ing or by executing `docker stop btfs` from another shell.

See the `docker-compose.yml` manifest file for more info and customizations.
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "2.4"
services:
btfs:
container_name: btfs
restart: unless-stopped
build: .
command:
- "-o"
- "allow_other"
- "--utp-only"
- "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel"
- "/mnt"
cap_add:
- ALL
- SYS_ADMIN
devices:
- /dev/fuse
privileged: true
security_opt:
- apparmor:unconfined
volumes:
- /tmp/btfs-docker/:/mnt/:shared