2017-09-23 177 views
1

我有一個運行在Ubuntu碼頭集裝箱中的Jenkins。爲了通過構建以dockerized,我需要在這個容器 我的問題是,我不知道如何啓動守護碼頭工人也跑碼頭工人:如何從另一個碼頭集裝箱啓動碼頭-ubuntu

的Dockerfile:

FROM ubuntu 

# this is a non-interactive automated build - avoid some warning 

messages 
ENV DEBIAN_FRONTEND noninteractive 

# update dpkg repositories 
RUN apt-get update 

# install wget 
RUN apt-get install -y wget 
RUN apt-get update -qq && apt-get install -qqy \ 
apt-transport-https \ 
ca-certificates \ 
curl \ 
tar \ 
lxc \ 
iptables 

# Install Docker from Docker Inc. repositories. 
RUN apt-get update && apt-get install -y docker.io 

#install jenkins 

...

COPY jenkins.sh /usr/local/bin/jenkins.sh 
ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"] 
+0

你應該使用官方的'泊塢窗:dind'圖像,並從主文件夾'-v /var/run/docker.sock:/var/run/docker傳遞套接字。襪子'而且你需要它在詹金斯奴隸而不是主詹金斯 –

回答

0

我覺得,這不是:

RUN apt-get update && apt-get install -y docker.io  

RUN curl -sSL https://get.docker.com/ | sh 

沒有jenkinsSlave需要