openEuler安装qBittorrent笔记

本文详细介绍了如何在openEuler22.03LTSSSP3系统上手动安装docker24.0.9,配置docker服务为systemd守护进程,以及设置docker-compose以管理和部署qBittorrent。过程中涉及了IPv6配置、网络设置和容器操作等步骤。
摘要由CSDN通过智能技术生成

openEuler安装qBittorrent笔记

openEuler 22.03 LTS SP3
docker 18
docker-compose 1.2

因需更新docker 20版本以上才支持ipv6
openEuler 22.03 LTS SP3 手动安装docker24.07

查询可用版本
连接:
https://download.docker.com/linux/static/stable/x86_64/

下载docker二进制包到/home目录文件

cd /home
wget https://download.docker.com/linux/static/stable/x86_64/docker-24.0.9.tgz

解压并移动到/usr/bin/目录

tar xvf docker-24.0.9.tgz
cp docker/* /usr/bin/

将docker注册为service

cat > /etc/systemd/system/docker.service << EOF
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd --selinux-enabled=false -H unix://
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process

Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target

EOF

加载配置,启动docker,并设置开机启动

systemctl daemon-reload
systemctl start docker
systemctl enable docker

查看docker运行情况

systemctl status docker

安装docker-compose
下载地址:
https://github.com/docker/compose/releases

下载并移动到bin目录,然后设置运行权限

wget https://github.com/docker/compose/releases/download/v2.24.6/docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 /usr/bin/docker-compose
chmod +x /usr/bin/docker-compose
vim /etc/docker/daemon.json
{
    "registry-mirrors": ["http://hub-mirror.c.163.com"]"ipv6": true,
    "fixed-cidr-v6": "fd00::/80",
    "experimental": true,
    "ip6tables": true
}
docker inspect bridge
[
    {
        "Name": "bridge",
        "Id": "aea616b48add22af2b2639d252fc49ca13d7c7687334cd8555c377717d8ea229",
        "Created": "2024-02-12T09:44:07.80422509+08:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "1877c14eb3dc459c97f70db4186299014a5ab1b6a15e50141445d16c3a237f90": {
                "Name": "qbittorrent",
                "EndpointID": "1b7d16b2a9d6a96db666a75f62fe9c87bcd2eb11955b241b7d909a6d2634ed8a",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

docker-compose
编写docker-cmpsoe的YAML配置文件,
这里文件路径为/home/qbit/

cd /home/qbit/
vim docker-compose.yml
 version: "2"
 services:
   qbittorrent:
     image: linuxserver/qbittorrent
     container_name: qbittorrent
     environment:
       - PUID=1000
       - PGID=1000
       - TZ=Asia/Shanghai # 你的时区
       - UMASK_SET=022    # (可选)默认022
       - WEBUI_PORT=8081  # WEB UI 端口 
     volumes:
       - /home/qbit/config:/config
       - /home/downloads:/downloads
     ports:
       - 6881:6881 # 最好更改,否者某些PT站点会屏蔽6881端口,为了避免被ISP屏蔽。⚠修改后,要在web界面同步修改
       - 6881:6881/udp
       - 8081:8081 # 考虑到CSRF和映射问题,内外端口必须与WEBUI_PORT一致。
     network_mode: host # 配置容器用主机网络
     restart: unless-stopped

version:“2”

 networks:
  local_bridge:
    enable_ipv6: true
    driver: bridge
    ipam:
      config:
        - subnet: "fe80:1001::/80"

version:“3”

 networks:
  dockerbridge:
    external:
      name: dockerbridge

新建容器,必须cd到yml目录再运行容器

docker-compose up -d

关闭容器

docker-compose down

查看docker网络

docker inspect bridge

查看docker容器详细信息

docker ps

示例:

CONTAINER ID   IMAGE                     COMMAND   CREATED         STATUS         PORTS     NAMES
8cc916bb05c1   linuxserver/qbittorrent   "/init"   4 minutes ago   Up 4 minutes             qbittorrent

查看容器ID对应的详细信息

docker inspect 8cc916bb05c1

查看qbit对应容器的日志,找到qbit随机的默认密码

docker logs 8cc916bb05c1 # 8cc916bb05c1 记得换为自己的ID

示例:

******** Information ********
To control qBittorrent, access the WebUI at: http://localhost:8081

The WebUI administrator username is: admin
The WebUI administrator password was not set. A temporary password is provided for this session: 4WmYLjTZb
You should set your own password in program preferences.
Connection to localhost (::1) 8081 port [tcp/tproxy] succeeded!
[ls.io-init] done.

4WmYLjTZb 即为qBittorrent随机的默认密码

连接不上可以尝试一下把

vim /home/qbit/config/qBittorrent/qBittorrent.conf

enabled=false 改为true

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值