为了账号安全,请及时绑定邮箱和手机立即绑定

使用 mac m1 命令“supervisorctl restart”失败并返回退出代码

使用 mac m1 命令“supervisorctl restart”失败并返回退出代码

Go
回首忆惘然 2022-11-28 14:36:09
我在 mac m1、docker、gulp 上运行。我的第一个错误是找不到命令 ld,但我在这里修复了它。如何解决 running gcc failed exist status 1 in mac m1?之后它导致我出现这个错误。这是完整的错误:[17:09:04] 'restart-supervisor' errored after 1.04 s[17:14:45] '<anonymous>' errored after 220 ms[17:14:45] Error in plugin "gulp-shell"Message:    Command `supervisorctl restart projectname` failed with exit code 7[17:14:45] 'restart-supervisor' errored after 838 ms我做了很多研究:我试过这样做,但找不到命令。https://github.com/Supervisor/supervisor/issues/121这也是。 https://github.com/Supervisor/supervisor/issues/1223。我什至把我的形象改成arm64v8/golang:1.17-alpine3.14这是我的 gulpfile.js:var gulp = require("gulp");var shell = require('gulp-shell');gulp.task("build-binary", shell.task('go build'));gulp.task("restart-supervisor", gulp.series("build-binary", shell.task('supervisorctl restart projectname')))gulp.task('watch', function() {    gulp.watch([                "*.go",                 "*.mod",                 "*.sum",                 "**/*.go",                 "**/*.mod",                "**/*.sum"                ],                 {interval: 1000, usePolling: true},                gulp.series('build-binary', 'restart-supervisor'    ));});gulp.task('default', gulp.series('watch'));这是我当前的 dockerfile:FROM arm64v8/golang:1.17-alpine3.14RUN apk update && apk add gcc make git libc-dev binutils-gold# Install dependenciesRUN apk add --update tzdata \    --no-cache ca-certificates git wget \    nodejs npm \    g++ \    supervisor \    && update-ca-certificates \    && npm install -g gulp gulp-shellCOPY ops/api/local/supervisor /etcENV PATH $PATH:/go/binWORKDIR /go/src/github.com/projectname/src/api在我的 docker-compose.yaml 我有这个:entrypoint:  [    "sh",    "-c",    "npm install gulp gulp-shell && supervisord -c /etc/supervisord.conf && gulp"  ]vim /etc/supervisord.conf:    #!/bin/sh[unix_http_server]    file=/tmp/supervisor.sock    username=admin    password=revproxy    但说真的,这个 mac m1 有什么问题。我试过在 rosetta 和非 rosetta 版本 2 中这样做。如果我的问题标题有误,请纠正我,我也不确定我的错误。
查看完整描述

1 回答

?
不负相思意

TA贡献1777条经验 获得超10个赞

我通过添加#!/bin/sh和解决了问题startsecs=0,没有显示错误,但下一个问题是 API 没有运行。



查看完整回答
反对 回复 2022-11-28
  • 1 回答
  • 0 关注
  • 213 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号