I would like to create a Docker container image that has FFMPEG and NodeJs installed. I am trying a multistage build Dockerfile as follows using the jrottenberg/ffmpeg and node:12 Docker images:
FROM jrottenberg/ffmpeg AS base
FROM node:12 as patch
ENTRYPOINT [ "node", "--version" ]
This container displays the node version correctly as v12.20.2 (as expected). However, if I change the ENTRYPOINT to ffmpeg, I get an error. The modified Dockerfile is as follows:
FROM jrottenberg/ffmpeg AS base
FROM node:12 as patch
ENTRYPOINT [ "ffmpeg", "-version" ]
The error is:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "ffmpeg": executable file not found in $PATH: unknown.
I intend to use a NodeJS program that would spawn FFMPEG as a child process within the container. How do I get this to work?
I have also tried using RUN apt-get install nodejs
instruction in the Dockerfile instead of the FROM node:12
. That also does not work.
Update:
Incorporating feedback from @David Maze, the following dockerfile accomplished my original goal of NodeJs + FFMPEG on the image.
FROM node:alpine
RUN apk add ffmpeg
COPY ./app.js .
ENTRYPOINT node app.js
Although it is doesn't use a multistage build as I originally intended, it accomplished the purpose. The image size was also much smaller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.