mindoc icon indicating copy to clipboard operation
mindoc copied to clipboard

希望能支持arm64架构平台docker部署

Open wicever opened this issue 3 years ago • 5 comments

请按照一下格式提交issue,谢谢!

  1. 你当前使用的是哪个版本的 MinDoc(godoc_linux_amd64 version)? v2.0

  2. 你当前使用的是什么操作系统? armbian 5.77

  3. 你是如何操作的? 直接拉取docker镜像运行

mkdir -p /home/armbian/mindoc-docker
export MINDOC=/home/armbian/mindoc-docker
docker run -it --name=mindoc --restart=always -v "${MINDOC}":"/mindoc-sync-host" -p 8181:8181 -e MINDOC_ENABLE_EXPORT=true -d registry.cn-hangzhou.aliyuncs.com/mindoc-org/mindoc:v2.1-beta.5

日志一直在报:standard_init_linux.go:228: exec user process caused: exec format error 浏览器无法访问

拉取代码打包docker镜像

git clone https://gitee.com/gsw945/mindoc.git
cd mindoc 
vim Dockerfile 

FROM amd64/golang:1.13 AS build 改为 FROM arm64v8/golang:1.13 AS build 将其他 amd64改为arm64 执行 docker build -t mindoc:v2.1 .

执行到:

Step 28/60 : RUN apt install -y ca-certificates
 ---> Running in 37881eb6cf92

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ca-certificates : Depends: openssl (>= 1.1.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
The command '/bin/bash -c apt install -y ca-certificates' returned a non-zero code: 100

  1. 你期望得到什么结果? 树莓派、N1盒子 之类arm架构平台能够部署docker

  2. 当前遇到的是什么结果?

使用现有的docker镜像启动后报错,自己打包镜像也报错

  1. 镜像启动后一直

wicever avatar Jan 19 '22 09:01 wicever

打包 不安装 calibre 可成功打包镜像,但启动时报错:

+ /mindoc/mindoc_linux_arm64 install
2022/01/23 21:25:49.520 [I] [command.go:37]  正在初始化数据库配置.
[ORM]2022/01/23 21:25:49 register db Ping `default`, dial tcp 172.17.0.2:3309: connect: connection refused
2022/01/23 21:25:49.523 [E] [command.go:61]  注册默认数据库失败-> register db Ping `default`, dial tcp 172.17.0.2:3309: connect: connection refused

docker 启动命令:

docker run -it -p 8181:8181 --name=mindoc --restart=always -v /data/uploads:/mindoc/uploads --link mysql -e MINDOC_DB_ADAPTER=mysql -e MINDOC_DB_HOST=mysql -e MINDOC_DB_PORT=3309 -e MINDOC_DB_DATABASE=mindoc_db -e MINDOC_DB_USERNAME=xxx -e MINDOC_DB_PASSWORD=xxx -e MINDOC_CACHE=true -e MINDOC_CACHE_PROVIDER=file -e MINDOC_ENABLE_EXPORT=true -e MINDOC_PORT=80 -d mindoc:2.1

其他容器用mindoc配置的地址、账号、密码连mysql没问题。

wicever avatar Jan 23 '22 13:01 wicever

确实,这个需求挺大的

masterzht avatar Feb 10 '22 07:02 masterzht

大哥是把项目跑在软路由了吗

mikemhm avatar Mar 14 '22 06:03 mikemhm

你先在arm下用非docker方式编译好,然后直接构建一个nginx的docker,比如用docker-compose,其中用command带上mindoc命令即可,在nginx配置文件中使用localhost端口转发,安全&反代,比直接构建强,我在我网站这么搭成功了,(如果用非根目录的话,记得去app.conf修改一行路径前缀标识变量即可。支持迁移,只需要在一台机器编译好一次即可

ywz978020607 avatar Dec 15 '23 16:12 ywz978020607

大哥是把项目跑在软路由了吗

我是的,很好用

ywz978020607 avatar Dec 15 '23 16:12 ywz978020607