jenkins上运行启动docker容器的脚本是报错

Jieq 发布于 2017/02/13 11:50
阅读 553
收藏 0
Started by user zhushengjie
Building in workspace /var/jenkins_home/workspace/java-app
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://git.oschina.net/zhushengjie/second.git # timeout=10
Fetching upstream changes from https://git.oschina.net/zhushengjie/second.git
 > git --version # timeout=10
 > git fetch --tags --progress https://git.oschina.net/zhushengjie/second.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision ad2ece7601fdcf0564216347b6fd8352068ddabc (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f ad2ece7601fdcf0564216347b6fd8352068ddabc
 > git rev-list ad2ece7601fdcf0564216347b6fd8352068ddabc # timeout=10
[java-app] $ /bin/sh -xe /tmp/hudson664768847703441055.sh
+ REGISTRY_URL=192.168.181.129:5000
+ cp /root/apache-maven-3.3.3-bin.tar.gz /var/jenkins_home/workspace/java-app/maven
+ docker build -t csphere/maven:3.3.3 /var/jenkins_home/workspace/java-app/maven
Sending build context to Docker daemon 8.135 MB

Step 1/9 : FROM csphere/jdk:1.7.0
 ---> f1397a72d881
Step 2/9 : MAINTAINER Carson,C.J.Zeong <zcy@nicescale.com>
 ---> Using cache
 ---> 7e147cce145c
Step 3/9 : ENV MAVEN_VERSION 3.3.3
 ---> Using cache
 ---> 88c34cdbb58f
Step 4/9 : ENV MAVEN_HOME /opt/maven
 ---> Using cache
 ---> ec6ac9e7c6d0
Step 5/9 : COPY apache-maven-3.3.3-bin.tar.gz /opt/
 ---> Using cache
 ---> a9757b445106
Step 6/9 : RUN tar xzf /opt/apache-maven-3.3.3-bin.tar.gz -C /opt &&     mv /opt/apache-maven-${MAVEN_VERSION} /opt/maven  &&     ln -s /opt/maven/bin/mvn /usr/bin/mvn
 ---> Using cache
 ---> 1c4075a5d1e5
Step 7/9 : COPY settings.xml /opt/maven/conf/settings.xml
 ---> Using cache
 ---> d6b7dad9c6fa
Step 8/9 : ADD hello /hello
 ---> Using cache
 ---> aa647c613f0d
Step 9/9 : RUN cd /hello &&     mvn clean install -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
 ---> Using cache
 ---> 975f3a411c7b
Successfully built 975f3a411c7b
+ docker ps -a
+ grep -i maven
ebc70cfb6ce0        4835161a4abd                             "/usr/bin/supervis..."   24 minutes ago      Created                                                         maven
+ docker rm -f maven
maven
+ docker create --name maven csphere/maven:3.3.3
20e71d62113dea2e9211b14214ea021d6446d337d4740243ed43e675a5cd9224
+ docker cp maven:/hello/target/hello.war /var/jenkins_home/workspace/java-app/hello
+ docker build -t 192.168.181.129:5000/csphere/hello:1.0 /var/jenkins_home/workspace/java-app/hello
Sending build context to Docker daemon 3.687 MB

Step 1/4 : FROM csphere/tomcat:7.0.55
# Executing 1 build trigger...
Step 1/1 : ADD . ${APP_DIR}
 ---> Using cache
 ---> 437d8c75fff9
Step 2/4 : MAINTAINER Carson,C.J.Zeong <zcy@nicescale.com>
 ---> Using cache
 ---> 30afb98ba885
Step 3/4 : ADD init /init
 ---> Using cache
 ---> d3b03948f722
Step 4/4 : ENTRYPOINT /init /scripts/run
 ---> Using cache
 ---> ec3189b35758
Successfully built ec3189b35758
+ docker push 192.168.181.129:5000/csphere/hello:1.0
The push refers to a repository [192.168.181.129:5000/csphere/hello]
cdd07f66369a: Preparing
9ac87f67de12: Preparing
f728a99fd601: Preparing
ed46f8ae79d8: Preparing
d01a6606b390: Preparing
b7c650f35997: Preparing
fde9df803484: Preparing
01ec24d052f5: Preparing
871820fa8a8e: Preparing
d07747dbfbbd: Preparing
1945b6a751a8: Preparing
555cede19b88: Preparing
ef884ade28d6: Preparing
b7c650f35997: Waiting
fde9df803484: Waiting
01ec24d052f5: Waiting
871820fa8a8e: Waiting
d07747dbfbbd: Waiting
1945b6a751a8: Waiting
555cede19b88: Waiting
ef884ade28d6: Waiting
d01a6606b390: Layer already exists
9ac87f67de12: Layer already exists
f728a99fd601: Layer already exists
cdd07f66369a: Layer already exists
ed46f8ae79d8: Layer already exists
b7c650f35997: Layer already exists
871820fa8a8e: Layer already exists
1945b6a751a8: Layer already exists
01ec24d052f5: Layer already exists
d07747dbfbbd: Layer already exists
555cede19b88: Layer already exists
fde9df803484: Layer already exists
ef884ade28d6: Layer already exists
1.0: digest: sha256:14f217c7f4462ad756cd90c36cfdf504fc4324ead665e4b784b2699fab3a3fad size: 3040
+ + grep -i hello
docker ps -a
c7d8b6601d0b        ff0dbce216c1            "/init /scripts/run"     24 minutes ago      Up 24 minutes       22/tcp, 8443/tcp, 0.0.0.0:80->8080/tcp      hello
+ docker rm -f hello
hello
+ docker run -d -p 80:8080 --name hello 192.168.181.129:5000/csphere/hello:1.0
53d4608a337bb6257a33bbefdb91eb50b48f6a36df93717a38fb12543aa7b91b
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"/init\": permission denied".
Build step 'Execute shell' marked build as failure
Finished: FAILURE
加载中
0
Jieq
Jieq

我用jenkins上的脚本在自己的虚拟机上跑起来是可以创建成功并运行docker容器的

返回顶部
顶部