jenkins构建的时候报错Permission denied
# 构建的命令如下: echo 'hello world' #!/bin/bash CONTAINER=${container_name} PORT=${port} echo $CONTAINER echo $PORT # 完成了镜像的构建 docker build --no-cache -t ${image_name}:${tag} . # echo 'hello world' RUNNING=${docker inspect --format="{{ .State.Running}}" $CONTAINER 2 > /dev/null} if[ ! -n $RUNNING ]; then echo "$CONTAINER dose not exists" return 1 fi if [ "$RUNNING" == "false" ]; then echo "$CONTAINER is running" matchingStarted=$(docker ps --filter="name=$CONTAINER" -q | xargs) if [ -n $matchingStarted ]; then docker stop $matchingStarted fi matching=$(docker ps -a --filter="name=$CONTAINER" -q | xargs) if [ -n $matching ]; then docker rm $matching fi fi echo "RUNNING is ${RUNNING}" # 运行服务 docker run -itd --name $CONTAINER -p $PORT:80 ${image_name}:${tag}
权限问题吗?还是我脚本根本就写错了。。。
正在回答 回答被采纳积分+1
报错详细信息:
Step 8/10 : EXPOSE 12005
---> Running in b58893509bc3
Removing intermediate container b58893509bc3
---> 050c0499d764
Step 9/10 : VOLUME ["/app/public"]
---> Running in 7d208502aebe
Removing intermediate container 7d208502aebe
---> 71a594ff24c6
Step 10/10 : CMD ["node", "dist/server.bundle.js"]
---> Running in e22c3805d492
Removing intermediate container e22c3805d492
---> 4be81b1e49be
Successfully built 4be81b1e49be
Successfully tagged web:1.0
/tmp/jenkins7258326822800703499.sh: 12: /tmp/jenkins7258326822800703499.sh: cannot create /dev/null}: Permission denied
/tmp/jenkins7258326822800703499.sh: 12: /tmp/jenkins7258326822800703499.sh: Bad substitution
Build step 'Execute shell' marked build as failure
Finished: FAILURE
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星