记录 dockerfile 基于centos7 构建 java8+nodejs+puppeteer+ffmpeg 环境

FROM centos:7


##  源码安装 java8 sdk
ADD jdk-8u333-linux-x64.tar.gz /usr/local/
ENV JAVA_HOME /usr/local/jdk1.8.0_333
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin

源码安装nodejs
RUN yum install  -y tzdata-java wget
WORKDIR  /usr/local
COPY node-v16.15.0-linux-x64.tar.xz node-v16.15.0-linux-x64.tar.xz
#RUN #wget https://npmmirror.com/mirrors/node/v16.15.0/node-v16.15.0-linux-x64.tar.xz
RUN tar -xvf node-v16.15.0-linux-x64.tar.xz
RUN rm -rf node-v16.15.0-linux-x64.tar.xz
RUN mv node-v16.15.0-linux-x64 nodejs
RUN cd nodejs
RUN ln -s /usr/local/nodejs/bin/npm /usr/bin/npm
RUN ln -s /usr/local/nodejs/bin/node /usr/bin/node

//puppeteer依赖
RUN yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 -y
//设置npm淘宝依赖
RUN npm config set registry=https://registry.npm.taobao.org
//安装puppeteer
RUN npm install puppeteer

//安装ffmpeg 
RUN yum install -y epel-release
RUN rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
RUN rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
RUN yum install ffmpeg ffmpeg-devel -y

你可能感兴趣的:(学习记录,docker,java,node.js)