安装运行为docker容器的nod​​eJS应用程序的graphicsmagik和ffmpeg

我在我的Ubuntu 16.04服务器上部署了一个nodeJS应用程序(这是基于meteorJS和meteor buildmeteor build一个docker集装箱。 我的应用程序需要graphicsmagickffmpeg 。 据我所知, ffmpeg应该在libav-tools包中。

我的问题是如何获得这两个需要的软件包到我的应用程序作为docker集装箱运行?

我认为在服务器上通过apt-get graphicsmagick来安装它们是错误的,对吗?

对于这个nodeJS应用程序,我使用这个Dockerfile来创build一个docker镜像:

 FROM node:4.8-slim # Copy the application files COPY . / # Set required environment variables ENV NODE_ENV production ENV MONGO_URL mongodb://mongo:27017/ ENV ROOT_URL http://localhost ENV PORT 80 EXPOSE 80 # Download the required packages for production RUN (cd programs/server && npm install --silent) # Make the application run when running the container CMD ["node", "main.js"] 

我的应用程序使用这个package.json:

 { ... "dependencies": { ... "ffmpeg": "0.0.4", "fluent-ffmpeg": "^2.1.2", "gm": "^1.23.0", ... } } 

运行npm install应该添加gmffmpeg ,但是我想我需要在docker容器中安装这些包。