1

Hi I am using the following docker image:

FROM golang:alpine3.18

With ffmpeg: (probably here I am missing something)

RUN apk add --no-cache ffmpeg

However when trying to execute the following:

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))
}

I get this error:

 Failed to execute command: exec: "bash": executable file not found in $PATH
Eran
  • 1,628
  • 16
  • 31

2 Answers2

2

Alpine docker image doesn't have bash installed by default. It uses the Ash shell instead

The answer is already here Docker: How to use bash with an Alpine based docker image?

PRATHEESH PC
  • 1,461
  • 1
  • 3
  • 15
0

Do you tried to access the container and exec "bash" by terminal? Some containers have only "sh" command available by default. Otherwhise when you access the container check the files that you are trying to execute with the bash command are there in the container or are well linked in your machine with volumes.

Crater44
  • 1
  • 3