2017-06-29 50 views
1
  • 泊塢主體的金屬OS - CentOS的7.3
  • 詹金斯大師在容器中運行的泊塢主體金屬
  • 詹金斯2.6
  • 泊塢窗主機在端口4243

金屬聽我不是很熟悉詹金斯Docker Plugin,這也許真的是我的問題。但現在我的問題是,我期待Docker插件在我的Docker主機上分離一個容器,我已經在Docker插件的Jenkins配置中將我的Docker主機配置爲一個Cloud,並且當我將Docker插件連接到我的Docker主機時按「測試連接」: enter image description here詹金斯泊塢窗插件似乎並沒有被供應從容器詹金斯建立

我使用的碼頭工人集線器一個很普通的碼頭工人圖像作爲奴隸,而不是真正的問題在這一點上,因爲泊塢窗插件甚至沒有試圖旋轉了一個碼頭工人的容器從站: enter image description here

這裏是我簡單的Jenkins作業的配置,它運行,拉取源代碼並完成沒有錯誤,從不在任何點拖動奴隸容器: enter image description here enter image description here

這裏正在運行的作業的輸出沒有錯誤: enter image description here

  • 我已經重新啓動詹金斯安裝泊塢窗插件
  • 泊塢後,安裝在我的詹金斯大師集裝箱
  • Docker插件可以與我的Docker主機對話

這裏是我的Jenkins Master Dockerfile

#reference 
#https://engineering.riotgames.com/news/putting-jenkins-docker-container 

FROM jenkins:2.46.3 
MAINTAINER Brian Ogden 

#setup folder for jenkins to log and save war file to 
USER root 
RUN apt-get update && apt-get install -y make apt-transport-https ca-certificates curl gnupg2 software-properties-common 
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - 
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" 
RUN apt-get update && apt-get install -y docker-ce 
RUN mkdir /var/log/jenkins 
RUN mkdir /var/cache/jenkins 
RUN chown -R jenkins:jenkins /var/log/jenkins 
RUN chown -R jenkins:jenkins /var/cache/jenkins 
RUN gpasswd -a jenkins docker 
USER jenkins 


#give Jenkins a nice 8 GB memory pool and room to handle garbage collection 
#ENV JAVA_OPTS="-Xmx8192m" 
#give Jenkins a nice base pool of handlers and a cap 
#ENV JENKINS_OPTS="--handlerCountStartup=100 --handlerCountMax=300" 

ENV JENKINS_OPTS="--logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war" 

這裏是什麼,我想實現最終圖:enter image description here

回答

1

好吧,我想通感謝這個article。正如我懷疑這是我的Jenkins Docker插件配置設置。

首先,我不得不放棄我的奴隸碼頭工人模板圖像標籤:

enter image description here

然後我不得不改變我的詹金斯構建項目配置:enter image description here

現在泊塢窗插件的供應奴隸容器在我的Docker主機上