Browse Source

Remove docker information

It has been moved to its own repo: https://github.com/qbittorrent/docker-qbittorrent-nox

PR #18199.
adaptive-webui-19844
Chocobo1 2 years ago committed by GitHub
parent
commit
d2e595aac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      dist/docker/.env
  2. 62
      dist/docker/Dockerfile
  3. 101
      dist/docker/Readme.md
  4. 25
      dist/docker/docker-compose.yml
  5. 35
      dist/docker/entrypoint.sh

8
dist/docker/.env vendored

@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
# refer to Readme.md for an explanation of the variables
QBT_EULA=
QBT_VERSION=devel
QBT_WEBUI_PORT=8080
QBT_CONFIG_PATH=<your_path>/config
QBT_DOWNLOADS_PATH=<your_path>/downloads

62
dist/docker/Dockerfile vendored

@ -1,62 +0,0 @@ @@ -1,62 +0,0 @@
# image for building
FROM alpine:latest AS builder
ARG QBT_VERSION
# alpine linux qbittorrent package: https://git.alpinelinux.org/aports/tree/community/qbittorrent/APKBUILD
RUN \
apk --update-cache add \
boost-dev \
cmake \
g++ \
libtorrent-rasterbar-dev \
ninja \
qt6-qtbase-dev \
qt6-qttools-dev
RUN \
if [ "$QBT_VERSION" = "devel" ]; then \
wget https://github.com/qbittorrent/qBittorrent/archive/refs/heads/master.zip && \
unzip master.zip && \
cd qBittorrent-master ; \
else \
wget "https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-${QBT_VERSION}.tar.gz" && \
tar -xf "release-${QBT_VERSION}.tar.gz" && \
cd "qBittorrent-release-${QBT_VERSION}" ; \
fi && \
cmake \
-B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DGUI=OFF \
-DQT6=ON \
-DSTACKTRACE=OFF && \
cmake --build build && \
cmake --install build
# image for running
FROM alpine:latest
RUN \
apk --no-cache add \
doas \
libtorrent-rasterbar \
python3 \
qt6-qtbase \
tini
RUN \
adduser \
-D \
-H \
-s /sbin/nologin \
-u 1000 \
qbtUser && \
echo "permit nopass :root" >> "/etc/doas.d/doas.conf"
COPY --from=builder /usr/local/bin/qbittorrent-nox /usr/bin/qbittorrent-nox
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/sbin/tini", "-g", "--", "/entrypoint.sh"]

101
dist/docker/Readme.md vendored

@ -1,101 +0,0 @@ @@ -1,101 +0,0 @@
# qBittorrent-nox Docker Image
This Dockerfile allows you to build a Docker Image containing qBittorrent-nox
## Prerequisites
In order to build/run this image you'll need Docker installed: https://docs.docker.com/get-docker/
If you don't need the GUI, you can just install Docker Engine: https://docs.docker.com/engine/install/
It is also recommended to install Docker Compose as it can significantly ease the process: https://docs.docker.com/compose/install/
## Building Docker Image
* If you are using Docker (not Docker Compose) then run the following commands in this folder:
```shell
export \
QBT_VERSION=devel
docker build \
--build-arg QBT_VERSION \
-t qbittorrent-nox:"$QBT_VERSION" \
.
```
* If you are using Docker Compose then you should edit `.env` file first.
You can find an explanation of the variables in the following [Parameters](#parameters) section. \
Then run the following commands in this folder:
```shell
docker compose build \
--build-arg QBT_VERSION
```
### Parameters
#### Environment variables
* `QBT_EULA` \
This environment variable defines whether you accept the end-user license agreement (EULA) of qBittorrent. \
**Put `accept` only if you understand and accepted the EULA.** You can find
the EULA [here](https://github.com/qbittorrent/qBittorrent/blob/56667e717b82c79433ecb8a5ff6cc2d7b315d773/src/app/main.cpp#L320-L323).
* `QBT_VERSION` \
This environment variable specifies the version of qBittorrent-nox to be built. \
For example, `4.4.0` is a valid entry. You can find all tagged versions [here](https://github.com/qbittorrent/qBittorrent/tags). \
Or you can put `devel` to build the latest development version.
* `QBT_WEBUI_PORT` \
This environment variable sets the port number which qBittorrent WebUI will be binded to.
#### Volumes
There are some paths involved:
* `<your_path>/config` \
Full path to a folder on your host machine which will store qBittorrent configurations.
Using relative path won't work.
* `<your_path>/downloads` \
Full path to a folder on your host machine which will store the files downloaded by qBittorrent.
Using relative path won't work.
## Running container
* Using Docker (not Docker Compose), simply run:
```shell
export \
QBT_EULA=accept \
QBT_VERSION=devel \
QBT_WEBUI_PORT=8080 \
QBT_CONFIG_PATH="/tmp/bbb/config"
QBT_DOWNLOADS_PATH="/tmp/bbb/downloads"
docker run \
-t \
--read-only \
--rm \
--tmpfs /tmp \
--name qbittorrent-nox \
-e QBT_EULA \
-e QBT_WEBUI_PORT \
-p "$QBT_WEBUI_PORT":"$QBT_WEBUI_PORT"/tcp \
-p 6881:6881/tcp \
-p 6881:6881/udp \
-v "$QBT_CONFIG_PATH":/config \
-v "$QBT_DOWNLOADS_PATH":/downloads \
qbittorrent-nox:"$QBT_VERSION"
```
* Using Docker Compose:
```shell
docker compose up
```
Then you can login at: `http://127.0.0.1:8080`
## Stopping container
* Using Docker (not Docker Compose):
```shell
docker stop -t 1800 qbittorrent-nox
```
* Using Docker Compose:
```shell
docker compose down
```

25
dist/docker/docker-compose.yml vendored

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
version: "3.9"
services:
qbittorrent-nox:
build: .
container_name: qbittorrent-nox
environment:
- QBT_EULA=${QBT_EULA}
- QBT_VERSION=${QBT_VERSION}
- QBT_WEBUI_PORT=${QBT_WEBUI_PORT}
image: qbittorrent-nox:${QBT_VERSION}
ports:
# for bittorrent traffic
- 6881:6881/tcp
- 6881:6881/udp
# for WebUI
- ${QBT_WEBUI_PORT}:${QBT_WEBUI_PORT}/tcp
read_only: true
stop_grace_period: 30m
tmpfs:
- /tmp
tty: true
volumes:
- ${QBT_CONFIG_PATH}:/config
- ${QBT_DOWNLOADS_PATH}:/downloads

35
dist/docker/entrypoint.sh vendored

@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
#!/bin/sh
downloadsPath="/downloads"
profilePath="/config"
qbtConfigFile="$profilePath/qBittorrent/config/qBittorrent.conf"
if [ ! -f "$qbtConfigFile" ]; then
mkdir -p "$(dirname $qbtConfigFile)"
cat << EOF > "$qbtConfigFile"
[BitTorrent]
Session\DefaultSavePath=/downloads
Session\Port=6881
Session\TempPath=/downloads/temp
[LegalNotice]
Accepted=false
EOF
if [ "$QBT_EULA" = "accept" ]; then
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
else
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
fi
fi
# those are owned by root by default
# don't change existing files owner in `$downloadsPath`
chown qbtUser:qbtUser "$downloadsPath"
chown qbtUser:qbtUser -R "$profilePath"
doas -u qbtUser \
qbittorrent-nox \
--profile="$profilePath" \
--webui-port="$QBT_WEBUI_PORT" \
"$@"
Loading…
Cancel
Save