Skip to content
On this page

常用的docker镜像

备忘录 memos

官方仓库

  • docker run -d --name memos -p 8230:5230 -v ~/memos/:/var/opt/memos neosmemo/memos:latest

  • 通过反代加上https&支持websocket(必须)

sh
server {
        listen 80;
        server_name your_domain;
        location / {
          proxy_pass http://127.0.0.1:8230/;
          rewrite ^/(.*)$ /$1 break;
          proxy_redirect off;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Upgrade-Insecure-Requests 1;
          proxy_set_header X-Forwarded-Proto https;
        }
    }
server {
        listen 80;
        server_name your_domain;
        location / {
          proxy_pass http://127.0.0.1:8230/;
          rewrite ^/(.*)$ /$1 break;
          proxy_redirect off;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Upgrade-Insecure-Requests 1;
          proxy_set_header X-Forwarded-Proto https;
        }
    }

本地穿透 Frp

服务端搭建snowdreamtech/frps

bash
mkdir /etc/frp
vim /etc/frp/frps.toml
mkdir /etc/frp
vim /etc/frp/frps.toml
ini
bindAddr = "0.0.0.0"
bindPort = 7000
auth.method = "token" # 认证方式
auth.token = "AUTH_PASSWORD" # 认证密码
# 设置web-ui信息
webServer.addr = "0.0.0.0"
webServer.port = 7001
webServer.user = "USER"
webServer.password = "USER_PASSWORD"
bindAddr = "0.0.0.0"
bindPort = 7000
auth.method = "token" # 认证方式
auth.token = "AUTH_PASSWORD" # 认证密码
# 设置web-ui信息
webServer.addr = "0.0.0.0"
webServer.port = 7001
webServer.user = "USER"
webServer.password = "USER_PASSWORD"
bash
docker run --restart=always --network host -d -v /etc/frp/frps.toml:/etc/frp/frps.toml --name frps snowdreamtech/frps
docker run --restart=always --network host -d -v /etc/frp/frps.toml:/etc/frp/frps.toml --name frps snowdreamtech/frps

客户端搭建snowdreamtech/frpc

bash
mkdir /etc/frp
vim /etc/frp/frpc.toml
mkdir /etc/frp
vim /etc/frp/frpc.toml
ini
user = "chaos"
serverAddr = "SERVER_IP"
serverPort = 7000
auth.method = "token"
auth.token = "AUTH_PASSWORD"
# 将远程服务器的12222端口穿透到客户端的22端口
[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 12222
user = "chaos"
serverAddr = "SERVER_IP"
serverPort = 7000
auth.method = "token"
auth.token = "AUTH_PASSWORD"
# 将远程服务器的12222端口穿透到客户端的22端口
[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 12222
bash
docker run --restart=always --network host -d -v /etc/frp/frpc.toml:/etc/frp/frpc.toml --name frpc snowdreamtech/frpc
docker run --restart=always --network host -d -v /etc/frp/frpc.toml:/etc/frp/frpc.toml --name frpc snowdreamtech/frpc

ddns go

动态IP解析

https://github.com/jeessy2/ddns-go

bash
# 创建容器
docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root jeessy/ddns-go
# 进入http://ip:9876配置
# ipv6可不勾选
# 配置完成后,ping域名看是否解析到正确的IP
# 创建容器
docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root jeessy/ddns-go
# 进入http://ip:9876配置
# ipv6可不勾选
# 配置完成后,ping域名看是否解析到正确的IP

linux-proxy:v2A

shell
# web端口: 2017
docker run -d --restart=always --privileged --network=host --name v2raya -e V2RAYA_LOG_FILE=/tmp/v2raya.log -e V2RAYA_V2RAY_BIN=/usr/local/bin/v2ray -e V2RAYA_NFTABLES_SUPPORT=off -e IPTABLES_MODE=legacy -v /lib/modules:/lib/modules:ro -v /etc/resolv.conf:/etc/resolv.conf -v /etc/v2raya:/etc/v2raya mzz2017/v2raya
# 运行版本号:v2.2.5.1
# web端口: 2017
docker run -d --restart=always --privileged --network=host --name v2raya -e V2RAYA_LOG_FILE=/tmp/v2raya.log -e V2RAYA_V2RAY_BIN=/usr/local/bin/v2ray -e V2RAYA_NFTABLES_SUPPORT=off -e IPTABLES_MODE=legacy -v /lib/modules:/lib/modules:ro -v /etc/resolv.conf:/etc/resolv.conf -v /etc/v2raya:/etc/v2raya mzz2017/v2raya
# 运行版本号:v2.2.5.1

tips:

  • 导入节点->选择节点->启动;设置->大陆白名单【不生效尝试重启docker容器】
  • V2RAYA_V2RAY_BIN 变量控制内核是v2ray还是xray
  • https://github.com/v2rayA/v2rayA

lx-music源

python版:https://github.com/MeoProject/lx-music-api-server

shell
# 尝试数据卷挂载无效,懒得折腾了...
docker run --name lx-music-api-server -d -p 9763:9763 --restart always ikun0014/lx-music-api-docker
# 尝试数据卷挂载无效,懒得折腾了...
docker run --name lx-music-api-server -d -p 9763:9763 --restart always ikun0014/lx-music-api-docker
  • 默认端口9763,访问http://ip:9763/script获取music源文件
  • 可修改title再导入LX-music中,也可以直接在线导入
  • 本站实验性搭建(随时关闭服务):https://chaoszhu.com/lx-music-source.js

glances 服务器状态监控面板

shell
# web端口: 61208
docker run -d --restart="always" -p 61208-61209:61208-61209 -e TZ="${TZ}" -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host nicolargo/glances:latest-full
# web端口: 61208
docker run -d --restart="always" -p 61208-61209:61208-61209 -e TZ="${TZ}" -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host nicolargo/glances:latest-full

GitHubProxy

shell
docker run -d --name="gh-proxy-py" -p 0.0.0.0:8080:80 --restart=always hunsh/gh-proxy-py:latest
docker run -d --name="gh-proxy-py" -p 0.0.0.0:8080:80 --restart=always hunsh/gh-proxy-py:latest

gost:http&socks5 proxy

2024/05推荐使用: x-ui

bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)

shell
# 安装gost:
snap install gost 【ubuntu】

# 后台指令:
nohup gost -L=admin:123456@:23333 > gost.log 2>&1 &
# 安装gost:
snap install gost 【ubuntu】

# 后台指令:
nohup gost -L=admin:123456@:23333 > gost.log 2>&1 &
  • 有认证的http&socks5【chrome中使用switchyOmega只有代理http才会弹出认证框】

docker run -d --net=host --name gost ginuerzh/gost -L=admin:123456@:23333

  • 无认证的http&socks5

docker run -d -p --net=host --name gost ginuerzh/gost -L=:23333

  • 代理配置
shell
# 有认证
export http_proxy=http://admin:123456@127.0.0.1:23333
export https_proxy=http://admin:123456@127.0.0.1:23333

# 无认证
export http_proxy=http://127.0.0.1:23333
export https_proxy=http://127.0.0.1:23333
# 有认证
export http_proxy=http://admin:123456@127.0.0.1:23333
export https_proxy=http://admin:123456@127.0.0.1:23333

# 无认证
export http_proxy=http://127.0.0.1:23333
export https_proxy=http://127.0.0.1:23333

跨平台的下载工具 gopeed

https://github.com/GopeedLab/gopeed/blob/main/README_zh-CN.md

shell
# 端口: 9999
docker run -d -p 9999:9999 -v /path/to/download:/root/Downloads liwei2633/gopeed
# 端口: 9999
docker run -d -p 9999:9999 -v /path/to/download:/root/Downloads liwei2633/gopeed

远程桌面 rustdesk

参考:https://blog.laoda.de/archives/docker-compose-install-rustdesk#1.-介绍

  • mkdir -p /root/data/docker_data/rustdesk
  • cd /root/data/docker_data/rustdesk
  • vim docker-compose.yml
yml
version: '3'

networks:
  rustdesk-net:
    external: false

services:
  hbbs:
    container_name: hbbs
    ports:
      - 21115:21115
      - 21116:21116
      - 21116:21116/udp
      - 21118:21118
    image: rustdesk/rustdesk-server:latest
    command: hbbs -r xxx.com:21117 # 你的域名
    volumes:
      - ./hbbs:/root
    networks:
      - rustdesk-net
    depends_on:
      - hbbr
    restart: unless-stopped

  hbbr:
    container_name: hbbr
    ports:
      - 21117:21117
      - 21119:21119
    image: rustdesk/rustdesk-server:latest
    command: hbbr
    volumes:
      - ./hbbr:/root
    networks:
      - rustdesk-net
    restart: unless-stopped
version: '3'

networks:
  rustdesk-net:
    external: false

services:
  hbbs:
    container_name: hbbs
    ports:
      - 21115:21115
      - 21116:21116
      - 21116:21116/udp
      - 21118:21118
    image: rustdesk/rustdesk-server:latest
    command: hbbs -r xxx.com:21117 # 你的域名
    volumes:
      - ./hbbs:/root
    networks:
      - rustdesk-net
    depends_on:
      - hbbr
    restart: unless-stopped

  hbbr:
    container_name: hbbr
    ports:
      - 21117:21117
      - 21119:21119
    image: rustdesk/rustdesk-server:latest
    command: hbbr
    volumes:
      - ./hbbr:/root
    networks:
      - rustdesk-net
    restart: unless-stopped
  • 打开防火墙的端口: TCP(21115, 21116, 21117, 21118, 21119)、UDP(21116)
shell
# 启动
docker-compose up -d
# 启动
docker-compose up -d

官网下载平台应用,ID服务器与中继服务器输入域名即可

在线vscode code-server

官方仓库code-server

镜像仓库docker-code-server

shell
docker run -d \
  --name=code-server \
  --net host `#面板端口8443`  \
  --restart unless-stopped \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Shanghai \
  -e PASSWORD=xxxxx `#web面板密码`  \
  -e SUDO_PASSWORD=admin `#root用户密码`  \
  -e DEFAULT_WORKSPACE=/config/workspace  \
  -v ~/code-server:/config `#配置映射路径` \
  lscr.io/linuxserver/code-server:latest
docker run -d \
  --name=code-server \
  --net host `#面板端口8443`  \
  --restart unless-stopped \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Shanghai \
  -e PASSWORD=xxxxx `#web面板密码`  \
  -e SUDO_PASSWORD=admin `#root用户密码`  \
  -e DEFAULT_WORKSPACE=/config/workspace  \
  -v ~/code-server:/config `#配置映射路径` \
  lscr.io/linuxserver/code-server:latest
  • 通过反代加上https&支持websocket(必须)
sh
http {
# other config...
    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }

    server {
      listen 443 ssl;
      server_name your_domain;
      ssl_certificate your_domain_bundle.crt;
      ssl_certificate_key your_domain.key;
      ssl_session_timeout 5m;
      ssl_protocols TLSv1.2 TLSv1.3;
      ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
      ssl_prefer_server_ciphers on;
      location / {
        #proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass: http://127.0.0.1:8443;
      }
    }
    server {
      listen 80;
      server_name your_domain;
      return 301 https://$host$request_uri;
    }
}
http {
# other config...
    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }

    server {
      listen 443 ssl;
      server_name your_domain;
      ssl_certificate your_domain_bundle.crt;
      ssl_certificate_key your_domain.key;
      ssl_session_timeout 5m;
      ssl_protocols TLSv1.2 TLSv1.3;
      ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
      ssl_prefer_server_ciphers on;
      location / {
        #proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass: http://127.0.0.1:8443;
      }
    }
    server {
      listen 80;
      server_name your_domain;
      return 301 https://$host$request_uri;
    }
}

文件托管(网盘) filebrowser

https://github.com/filebrowser/filebrowser

创建挂在目录: mkdir /root/filebrowser

shell
# 端口: 8001
docker run -d --restart=always -v /root/downloads:/srv -v /root/filebrowser/filebrowserconfig.json:/etc/config.json -v /root/filebrowser/database.db:/etc/database.db --name myfile -p 8001:80 filebrowser/filebrowser
# 端口: 8001
docker run -d --restart=always -v /root/downloads:/srv -v /root/filebrowser/filebrowserconfig.json:/etc/config.json -v /root/filebrowser/database.db:/etc/database.db --name myfile -p 8001:80 filebrowser/filebrowser

PDF在线阅读

shell
docker run -d \
  --name=calibre-web \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Shanghai \
  -p 7777:8083 \
  -v /path/to/data:/config \
  -v /path/to/calibre/library:/books \
  --restart unless-stopped \
  linuxserver/calibre-web
docker run -d \
  --name=calibre-web \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Shanghai \
  -p 7777:8083 \
  -v /path/to/data:/config \
  -v /path/to/calibre/library:/books \
  --restart unless-stopped \
  linuxserver/calibre-web

配置指南:

shell
# 1.下载空数据库文件并配置好权限
cd /path/to/calibre/library
chmod 777 -R /path/to/calibre/library
wget https://ghproxy.com/https://github.com/chaos-zhu/chaos-zhu.github.io/raw/master/metadata.db
chmod 777 metadata.db
/books/metadata.db

# 2.web端配置(服务启动需大约2分钟)
# 默认登录账户: admin/admin123
# 输入数据库文件路径:/books/metadata.db
# 点击右边admin,设置中文语言;取消勾选所有菜单(显得干净);
# 点击管理权限->基本权限->功能配置->启用上传
# 1.下载空数据库文件并配置好权限
cd /path/to/calibre/library
chmod 777 -R /path/to/calibre/library
wget https://ghproxy.com/https://github.com/chaos-zhu/chaos-zhu.github.io/raw/master/metadata.db
chmod 777 metadata.db
/books/metadata.db

# 2.web端配置(服务启动需大约2分钟)
# 默认登录账户: admin/admin123
# 输入数据库文件路径:/books/metadata.db
# 点击右边admin,设置中文语言;取消勾选所有菜单(显得干净);
# 点击管理权限->基本权限->功能配置->启用上传

protainer:可视化docker容器管理

  • docker run -d -p 7777:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data -v /root/Portainer-CN/public:/public --name portainer --restart=always portainer/portainer

WARNING

    1. 其中: -v /root/Portainer-CN/public:/public 为汉化包挂载卷
    1. 下载汉化文件, 上传到服务器目录:/root/Portainer-CN/public
    1. 访问管理面板:http://ip:7777 --> 选择Local --> Connect

nginx配置

nginx
server {
    listen 80;
    server_name docker.xxx.xxx;
      # ^~ 表示如果该符号后面的字符是最佳匹配,采用该规则,不再进行后续的查找。
    location / {
      proxy_pass http://127.0.0.1:7777/;
    }
}
server {
    listen 80;
    server_name docker.xxx.xxx;
      # ^~ 表示如果该符号后面的字符是最佳匹配,采用该规则,不再进行后续的查找。
    location / {
      proxy_pass http://127.0.0.1:7777/;
    }
}

图床 Lsky(兰空)

项目地址

镜像地址

shell
docker run -d --name=lsky-pro --restart=always -v /path/to/mount/lsky-pro-data:/var/www/html -p 7791:80 dko0/lsky-pro:2.0.4
docker run -d --name=lsky-pro --restart=always -v /path/to/mount/lsky-pro-data:/var/www/html -p 7791:80 dko0/lsky-pro:2.0.4

qbittorrent

文档

shell
docker run -d \
    --name qbittorrent \
    -p 38080:8080 \
    -e PUID=1000 \
    -e PGID=1000 \
    -e UMASK=002 \
    -e TZ="Asia/Shanghai" \
    -v /root/qBittorrent/config:/config \
    cr.hotio.dev/hotio/qbittorrent
docker run -d \
    --name qbittorrent \
    -p 38080:8080 \
    -e PUID=1000 \
    -e PGID=1000 \
    -e UMASK=002 \
    -e TZ="Asia/Shanghai" \
    -v /root/qBittorrent/config:/config \
    cr.hotio.dev/hotio/qbittorrent
  • 默认用户名/密码:admin/adminadmin

  • 启用Vue-UI: 设置 --> Web UI --> 勾选: Use alternative Web UI

Alltube <