Tag: jenkins

如何在Cloudbees Pipeline中保存Docker卷以防失败

我在一个由Jenkins-Pipeline-Stage(Cloudbees-plugin)启动的Docker-Container中运行一组APItesting。 如果舞台(见下文)失败,我想保存testing日志。 我试图在后期采取后续操作,但之后我无法再访问该映像。 你将如何解决这个问题? 如何在失败的情况下保存图像? stage('build Dockerimage and run API-tests') { steps{ script { def apitestimage = docker.build('apitestimage', '–no-cache=true dockerbuild') apitestimage.inside('-p 5800:5800') { dir('testing'){ sh 'ctest -V' } } sh 'docker rmi –force apitestimage' } } }

如何在Jenkinsfile中运行图像时传递docker容器参数

我有一个Dockerfile结束 ENTRYPOINT ["node", "index.js"] CMD ["–help"] index.js可以采取两个不同的参数,我也需要公开一个端口的容器,所以如果我手动运行它,我做了这样的事情: docker run -p 3000:3000 my_container:latest –arg1 somearg –arg2 anotherarg 我如何在Jenkinsfile中执行此操作? 我的testing将与此容器进行通信,因此在运行testing之前需要先运行它。 我使用withRun()让它在testing运行之前运行,但我不知道如何指定–arg1 somearg –arg2 anotherarg stage('TestMicroservice') { // // HOW DO I SPECIFY '–arg1 somearg –arg2 anotherarg'? // docker.image("my_container:latest").withRun('-p 3000:3000') { sh 'npm run test-microservice' } }

Docker容器端口不可用

我有Jenkinsbuild立我的项目,并运行我的unit testing和集成testing。 在此之前, Jenkins推出了几个docker集装箱(内部有mongodb , cassandra等),然后启动。 有时,我的testing失败,因为他们无法获得资源。 挖了一下后,我注意到并不是所有的容器都开始了。 所以这里是我所拥有的: docker-compose.yml与每个docker集装箱的定义 start_docker.sh脚本: time docker-compose pull time docker-compose –project-name $JOB_NAME up -d time docker-compose –project-name $JOB_NAME ps echo "Wait services are started" docker-compose –project-name $JOB_NAME ps -q container_names=`docker-compose –project-name $JOB_NAME ps -q` container_nb="${#container_names}" for container_name in $container_names; do ports=`docker port $container_name | cut -d "/" -f1 ` […]

可以在docker中的jenkins服务器上configurationjenkins slave

我在manning练习docker工。 技术配方是关于configurationdocker集装箱jenkins奴隶。 下面是jenkins_slave的Dockerfile FROM ubuntu:latest ENV DEBIAN_FRONTEND noninteractive RUN groupadd -g 1000 jenkins_slave RUN useradd -d /home/jenkins_slave -s /bin/bash \ -m jenkins_slave -u 1000 -g jenkins_slave RUN echo jenkins_slave:jpass | chpasswd RUN apt-get update && \ apt-get install -y openssh-server openjdk-8-jre wget iproute2 RUN mkdir -p /var/run/sshd CMD ip route | grep "default via" \ […]

jenkins和docker – 撰写

我试图在jenkins版本上使用docker-compose。 但是我得到:docker-compose:找不到 如何安装docker-compose? 这是一个插件,或者我必须修改jenkins的docker形象? 我用jenkins:1.642.4 谢谢 !

下载Docker Jenkins图片后,在Ubuntu找不到jenkins_home文件夹

我从Docker中央存储库中提取了Docker-Jenkins镜像并运行以下命令 $ docker run -p 8080:8080 -p 50000:50000 Jenkins 在安装过程中,出现下面的几行。 *************************************************************************` Jenkins initial setup is required. An admin user has been created and a password generated. Please use the following password to proceed to installation: xxxxxxxxxxxxxxxxxxxxxx This may also be found at: /var/jenkins_home/secrets/initialAdminPassword *************************************************************************` 但是在我的/var ,不存在jenkins_home文件夹。 我得到以下错误,我无法访问我的jenkins使用localhost:8080 信息:Jenkins完全正常运行 2016年10月11日上午4时31分19秒winstone.Logger logInternal 信息:JVM正在终止。 closuresWinstone 当生成pipe理员密码时,我可以访问Jenkins仪表板。 但是,立即,JVM正在终止,我不能再访问Jenkins页面。

Jenkins使用Docker无法访问SonarQube服务器

我在Jenkins版本中添加了一个SonarQube扫描仪分析步骤,但该步骤失败: [Test_gitlab] $ /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/http_INTERNAL_DOCKER_IP_ADDRESS_9000/bin/sonar-scanner -e -Dsonar.host.url=SERVER_IP_ADDRESS:9000 ******** -Dsonar.projectBaseDir=/var/jenkins_home/workspace/Test_gitlab INFO: Option -e/–errors is no longer supported and will be ignored INFO: Scanner configuration file: /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/http_INTERNAL_DOCKER_IP_ADDRESS_9000/conf/sonar-scanner.properties INFO: Project root configuration file: NONE INFO: SonarQube Scanner 2.8 INFO: Java 1.8.0_102 Oracle Corporation (64-bit) INFO: Linux 3.10.0-327.10.1.el7.x86_64 amd64 INFO: User cache: /var/jenkins_home/.sonar/cache ERROR: SonarQube server [SERVER_IP_ADDRESS:9000] can not be […]

无法连接到运行在Mac上的Vagrant内的Jenkins docker容器

我在Mac上运行Vagrant – 分离Ubuntu VM。 Docker安装在Ubuntu VM上。 我拉下jenkins容器使用: docker pull jenkins并开始说: docker run -p 8080:8080 –name=jenkins-master jenkins 。 但是,我无法通过端口8080从浏览器连接到Jenkins。我尝试使用以下方法从浏览器到达Jenkins:1. http:// IP1:8080其中IP1是由命令docker inspect <container_name>返回的值。 2. http:// IP2:8080其中IP2是ubuntu虚拟机内命令'ifconfig'返回的eth0值。

jenkinspipe道运行后unit testingkarma脚本不停止

我创build了unjenkinspipe道,运行一个docker容器和nodeJs,karma和xvfb来运行unit testing。 testing成功通过,但即使在karmaconfiguration中使用captureTimeout:60000和singleRun:true,脚本也不会停止 我错了 [33m05 04 2017 16:01:54.227:WARN [karma]: [39mNo captured browser, open http://localhost:9876/ [32m05 04 2017 16:01:54.260:INFO [karma]: [39mKarma v1.3.0 server started at http://localhost:9876/ [32m05 04 2017 16:01:54.262:INFO [launcher]: [39mLaunching browser Chrome with unlimited concurrency [32m05 04 2017 16:01:54.282:INFO [launcher]: [39mStarting browser Chrome [32m05 04 2017 16:01:59.120:INFO [Chrome 57.0.2987 (Linux 0.0.0)]: [39mConnected on socket […]

用docker工具创buildjenkins图像

我想用dockerfile创build一个jenkins图像。 Docker正在运行(用hello-world映像试用它)。 我的Dockerfile: FROM jenkins:latest USER root RUN apt-get update && apt-get install -y build-essentials USER jenkins 我想用这个命令build立一个图像 sudo docker build -t "jenkins_master" . 但是我总是得到这个错误: E: Unable to locate package build-essentials The command '/bin/sh -c apt-get install build-essentials' returned a non-zero code: 100 我试过了: sudo服务docker重启 sudo rm / var / lib / apt / lists […]