昨天晚上准备将搭建在家里群晖 docker 上的 NPM 迁移到 OpenWrt 路由器的 docker 中去。
不想再一个一个重新配置域名反代解析,直接将群晖的 NPM docker 目录( docker-compose.yml 文件 和 data, letsencrypt 两个文件夹)拷贝到 OpenWrt 上去构建,发现无法启动成功。报错如下:
能力有限,网上搜索一些关键字没有大看明白,网上简单搜索了一下大概了解可能是跟 ssl 证书相关但不知道解决办法。
不知有没有佬哥知道如何解决这个问题呢?核心点就是想保留之前 NPM 配置好的域名解析。
附带 docker-compose.yml 内容如下:
services: app: image: 'jc21/nginx-proxy-manager:latest' container_name: nginx-proxy-manager restart: unless-stopped ports: # These ports are in format <host-port>:<container-port> - '19654:80' # Public HTTP Port - '1789:443' # Public HTTPS Port - '2345:81' # Admin Web Port # Add any other Stream port you want to expose # - '21:21' # FTP # Uncomment the next line if you uncomment anything in the section environment: TZ: Asia/Shanghai # Uncomment this if you want to change the location of # the SQLite DB file within the container DB_SQLITE_FILE: "/data/database.sqlite" # Uncomment this if IPv6 is not enabled on your host # DISABLE_IPV6: 'true' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt
![]() | 1 itechify PRO 你那边缺少文件,复制的 data 和 letsencrypt 目录文件完整吗,挂在的目录对了吗,修改 volumes 为绝对路径看看,或者修改--entrypoint 进去看看容器实际运行情况 ```bash docker run --rm \ --name nginx-proxy-manager \ -p 19654:80 \ -p 1789:443 \ -p 2345:81 \ -e DB_SQLITE_FILE="/data/database.sqlite" \ -v /xxx/xxx/data:/data \ -v /xxx/xxx/letsencrypt:/etc/letsencrypt \ --entrypoint /bin/sh jc21/nginx-proxy-manager:latest ``` 上面 /xxx/xxx 改为你的 data 和 letsencrypt 的父目录,模拟 npm 运行环境,ls -l /etc/letsencrypt 有没有对应的文件 |
![]() | 2 Exp OP @oneisall8955 感谢回复~ data 和 letsencrpt 目录文件是完整的,我整体拷贝过去的。 挂载路径也是相对路径: ```yaml volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt ``` 我再试试换成绝对路径看 |
![]() | 3 wheat0r 224 天前 考虑一下权限有没有问题 |
![]() | 4 Exp OP @oneisall8955 换成绝对路径结果也一样,进入到 docker 容器内部看了 /etc/letsencrypt/live/npm-1 下确实没有相关文件 @wheat0r 权限改为 777 也是一样。 再次感谢二位,不知还有没有其它尝试方向? |