【发布时间】:2021-04-26 00:46:09
【问题描述】:
我正在尝试转换这个程序:
下载JetAdvice Edge
完整安装指南可见here
从安装到 linux 机器,再到 Docker 容器。
我需要多个运行的实例,我在业余时间一直在使用 Docker,现在终于可以在我的工作中使用了!
当我构建它时,我已经完成了 dockerfile(我认为),它会下载并安装它需要的东西,并且构建完成没有问题。
但是,我无法运行 JetAdvice 程序/服务! 我读过,如果我想在一个容器中运行多个东西,我应该使用主管,并且由于 JetEdge 程序有 3 个正在运行的服务,我正在使用它。
这是我的 dockerfile:
FROM ubuntu
MAINTAINER me
EXPOSE 33322
COPY startup.sh /opt/scripts/startup.sh
RUN apt-get update && \
apt-get install -y apt-utils wget libunwind8 icu-devtools supervisor
RUN mkdir -p -- /var/log/supervisor /opt/print/download /opt/print/edgeinstaller /opt/scripts
RUN wget https://app.jetadvice.com/install/edge/jetadvice-edge-linux-x64.tar -P /opt/print/download && \
tar -xvf /opt/print/download/jetadvice-edge-linux-x64.tar -C /opt/print/edgeinstaller
RUN chmod +x /opt/print/edgeinstaller/Installer && \
/opt/print/edgeinstaller/Installer install
RUN chmod +x /usr/bin/JetAdvice/Edge/Edge && \
chmod +x /usr/bin/JetAdvice/Updater/Updater && \
chmod +x /usr/bin/JetAdvice/EdgeUI/EdgeUi && \
chmod +x /opt/scripts/startup.sh
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/opt/scripts/startup.sh"]
这是我的 supervisord.conf
[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
[program:JetAdvice-Edge]
command=/usr/bin/JetAdvice/Edge/Edge
[program:JetAdvice-Updater]
command=/usr/bin/JetAdvice/Updater/Updater
[program:JetAdvice-Edge-UI]
command=/usr/bin/JetAdvice/EdgeUI/EdgeUi
还有 startup.sh 脚本:
#!/bin/sh
#somethingvariblehere
/usr/bin/supervisord
我尝试了很多方法来运行 JetAdvice,但我无法让程序运行。
有关信息,这是 JedAdvice-Edge.service 文件之一:
Description=JetAdvice Edge connector service
Wants=network.target
After=syslog.target network-online.target
[Service]
Type = simple
ExecStart=/usr/bin/JetAdvice/Edge/Edge
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
如果我登录到我的 docker 容器并尝试运行该服务,我会收到此错误
root@6727e8f42044:/# service JetAdvice-Updater start
JetAdvice-Updater: unrecognized service
如果我尝试直接运行程序,我会得到:
root@6727e8f42044:/# /usr/bin/JetAdvice/Edge/Edge
bash: /usr/bin/JetAdvice/Edge/Edge: Permission denied
root@6727e8f42044:/# ./usr/bin/JetAdvice/Edge/Edge
bash: ./usr/bin/JetAdvice/Edge/Edge: Permission denied
我尝试在 /usr/bin/JetAdvice/Edge/Edge 上执行 chmod +x,然后程序似乎运行了 3 秒,然后什么也没发生。
root@6727e8f42044:/# chmod +x /usr/bin/JetAdvice/Edge/Edge
root@6727e8f42044:/# /usr/bin/JetAdvice/Edge/Edge
root@6727e8f42044:/#
我什至没有接近 linux 专家,但我无法想象我正在尝试做的事情是无法完成的。 那么我做错了什么,下一步是什么?
JetEdge 团队的工作 install.json 文件
{
"InstallConfig": {
"ApiClient": {
"SignIn": {
"InstallKey": "prettykeyhere",
"DcaInstanceID": "prettyidhere"
},
"HttpLogging": {
"MaxSize": 10240,
"LogHttp": false
},
"Proxy": {
"Address": "",
"Port": 8080,
"AutoDetect": true
}
},
"ApiEndpoint": {
"LoginBaseAddress": "https://auth.eu.edge-api.com",
"BaseAddress": "https://dr.eu.edge-api.com",
"ConfigBaseAddress": "https://config.eu.edge-api.com",
"StayAliveBaseAddress": "https://p.eu.edge-api.com",
"UpdateBaseAddress": "https://upd.eu.edge-api.com",
"UiApiBaseAddress": "https://ui.eu.edge-api.com",
"RangesBaseAddress": "https://ranges.eu.edge-api.com",
"LoggerBaseAddress": "https://log.eu.edge-api.com",
"StatusBaseAddress": "https://status.eu.edge-api.com"
},
"Installs": [
{
"Product": 1,
"Folder": "C:\\Program Files (x86)\\JetAdvice\\Updater",
"ServiceName": "JetAdvice-Updater",
"ServiceExe": "Updater.dll",
"Version": "0.4.18.0",
"BuildRID": "win-x86",
"Oem": 0
},
{
"Product": 10,
"Folder": "C:\\Program Files (x86)\\JetAdvice\\Edge",
"ServiceName": "JetAdvice-Edge",
"ServiceExe": "Edge.dll",
"Version": "0.4.24.0",
"BuildRID": "win-x86",
"Oem": 0
},
{
"Product": 20,
"Folder": "C:\\Program Files (x86)\\JetAdvice\\EdgeUI",
"ServiceName": "JetAdvice-Edge-UI",
"ServiceExe": "EdgeUi.dll",
"Version": "0.4.1.0",
"BuildRID": "win-x86",
"Oem": 0
}
]
}
}
我为测试生成的密钥是: 4809b732-eb36-413f-8993-bd8d1f2e2942
编辑,我已更新 dockerfile,并将 startup.sh 脚本添加到 OP。
【问题讨论】:
标签: docker dockerfile supervisord