问题内容 您好,我正在使用以下 Docker 映像: from golang:alpine3.18 使用 FFmpeg:(可能在这里我遗漏了一些东西) run apk add --no
您好,我正在使用以下 Docker 映像:
from golang:alpine3.18
使用 FFmpeg:(可能在这里我遗漏了一些东西)
run apk add --no-cache ffmpeg
但是当尝试执行以下操作时:
cmd := "ffmpeg -i untitled.mp4 -vf \"fps=5,scale=320:-1:flags=lanczos\" -c:v pam -f image2pipe - | convert -delay 5 - -loop 0 -layers optimize test.gif"
_, err := exec.command("bash", "-c", cmd).output()
if err != nil {
fmt.println(fmt.sprintf("failed to execute command: %s", err))
}
我收到此错误:
Failed to execute command: exec: "bash": executable file not found in $PATH
Alpine docker 镜像默认没有安装 bash。它使用 Ash shell 来代替
答案已经在这里 Docker:如何将 bash 与基于 Alpine 的 docker 镜像一起使用?
--结束END--
本文标题: Docker golang + ffmpeg 执行命令失败
本文链接: https://www.lsjlt.com/news/561496.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-04-05
2024-04-05
2024-04-05
2024-04-04
2024-04-05
2024-04-05
2024-04-05
2024-04-05
2024-04-04
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0