安装运行为docker容器的nodeJS应用程序的graphicsmagik和ffmpeg
我在我的Ubuntu 16.04服务器上部署了一个nodeJS应用程序(这是基于meteorJS和meteor build
) meteor build
一个docker集装箱。 我的应用程序需要graphicsmagick
和ffmpeg
。 据我所知, 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
应该添加gm
和ffmpeg
,但是我想我需要在docker容器中安装这些包。