您好,我正在使用以下 docker 映像:
1 |
from golang:alpine3.18 |
使用 ffmpeg:(可能在这里我遗漏了一些东西)
1 |
run apk add --no-cache ffmpeg |
但是当尝试执行以下操作时:
1 2 3 4 5 |
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)) } |
我收到此错误:
1 |
Failed to execute command: exec: "bash": executable file not found in $PATH |
Alpine docker 镜像默认没有安装 bash。它使用 Ash shell 来代替