我正在嘗試與docker運行Jenkins服務器。在Docker中運行Jenkins - 立即退出
我已經建立的形象,並試圖用這個命令運行它:
docker run -p 8080:8080 62a4e44bf4bf
的62a4e44bf4bf是泊塢窗圖像ID
每當我運行此命令時,它會立即關閉。
我試圖用這個命令:
docker run -i -t -p 8080:8080 62a4e44bf4bf
這將保持圖像的運行,但我似乎無法從我的瀏覽器使用此IP訪問詹金斯:本地主機:8080
DOCKERFILE:
FROM ubuntu:latest
#Oracle Java7 install
RUN apt-get install software-properties-common -y
RUN apt-get update
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN apt-get install -y oracle-java7-installer
#Jenkins install
RUN wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
RUN sudo echo "deb http://pkg.jenkins-ci.org/debian binary/" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install --force-yes -y jenkins
#Zip support install
RUN apt-get update
RUN apt-get -y install zip
#Unzip hang.zip
#RUN cp /shared/hang.zip /var/lib/jenkins
#RUN unzip -o /var/jenkins/hang.zip -d /var/lib/jenkins/
#Restart jenkins server
RUN service jenkins start
EXPOSE 8080