Recently has been engaged in Docker under the Jenkins+nodejs, in the last few days finally put some difficult problems to solve. I guess a lot of friends want to Docker under Jenkins+nodejs dockerfile file, I searched the Docker hub, Do not know is jenkins+nodejs with less or how, very few people share Jenkins+nodejs dockerfile file, now I write my share to everyone, hope not to spray me oh.
Software version: Jenkins 1.651.2
Nodejs 5.3.0 (If you think my Nodejs version is low, please change the high version yourself)
Docker 1.7.1
The following is the Dockerfile file for Jenkins+nodejs:
From jenkins:1.651.2
USER Root
RUN apt-get update && apt-get install-y \
Build-essential \
GCC \
Git \
python2.7
RUN wget http://nodejs.org/dist/v5.3.0/node-v5.3.0.tar.gz && \
Tar zxf node-v5.3.0.tar.gz && \
CD node-v5.3.0 && \
./configure && \
Make && \
Make install && \
Ln-s/usr/local/bin/node/usr/bin/node
RUN CD/&&
RM node-v5.3.0.tar.gz && \
RM-FR node-v5.3.0
RUN NPM Config Set Registry https://registry.npm.taobao.org
RUN Mkdir/var/app
Volume/var/app
USER Jenkins
Made into Docker mirrors:
Mkdir/tmp/jenkins_nodejs
MV dockerfile/tmp/jenkins_nodejs/
Docker build-t Rocdk890/jenkins-nodejs.
When done, use Docker images to see a rocdk890/jenkins-nodejs:latest mirror that integrates Jenkins+nodejs Docker mirrors.
Let's give you a starting example:
Docker run--name jenkins_nodejs-itd \
-P 8080:8080-p 3000:3000-p 50,000:50,000 \
-v/srv/docker/jenkins/jenkins:/var/jenkins_home \
-v/srv/docker/node/app:/var/app \
-U root \
Rocdk890/jenkins-nodejs:latest
OK, the rest of how to use Jenkins and Nodejs to see everyone, I do not have anything.
Original from: http://blog.slogra.com/post-653.html