skip to Main Content

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

2

Answers


  1. 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.

    Login or Signup to reply.
  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?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search