2015-04-20 96 views
0

我目前正在嘗試創建一個工作流動文件,允許我通過Docker啓動JIRA實例以進行測試。我Vagrantfile如下:流浪漢無法與Docker連接

Vagrant.configure("2") do |config| 
config.vm.provider "docker" do |vb| 
    vb.has_ssh = true 
    vb.build_dir = "." 
    vb.ports = ["8082:8080"] 
end 
end 

的Dockerfile:

FROM java:7 

# Configuration variables. 
ENV JIRA_HOME  /var/local/atlassian/jira 
ENV JIRA_INSTALL /usr/local/atlassian/jira 
ENV JIRA_VERSION 6.4.2 

# Install Atlassian Confluence and helper tools and setup initial home 
# directory structure. 
RUN set -x \ 
&& apt-get update --quiet \ 
&& apt-get install --quiet --yes --no-install-recommends libtcnative-1 xmlstarlet \ 
&& apt-get clean \ 
&& mkdir -p    "${JIRA_HOME}" \ 
&& chmod -R 700   "${JIRA_HOME}" \ 
&& chown -R daemon:daemon "${JIRA_HOME}" \ 
&& mkdir -p    "${JIRA_INSTALL}/conf/Catalina" \ 
&& curl -Ls    "http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-${JIRA_VERSION}.tar.gz" | tar -xz --directory "${JIRA_INSTALL}" --strip-components=1 --no-same-owner \ 
&& chmod -R 700   "${JIRA_INSTALL}/conf" \ 
&& chmod -R 700   "${JIRA_INSTALL}/logs" \ 
&& chmod -R 700   "${JIRA_INSTALL}/temp" \ 
&& chmod -R 700   "${JIRA_INSTALL}/work" \ 
&& chown -R daemon:daemon "${JIRA_INSTALL}/conf" \ 
&& chown -R daemon:daemon "${JIRA_INSTALL}/logs" \ 
&& chown -R daemon:daemon "${JIRA_INSTALL}/temp" \ 
&& chown -R daemon:daemon "${JIRA_INSTALL}/work" \ 
&& echo -e     "\njira.home=$JIRA_HOME" >> "${JIRA_INSTALL}/atlassian-jira/WEB-INF/classes/jira-application.properties" 

# Use the default unprivileged account. This could be considered bad practice 
# on systems where multiple processes end up being executed by 'daemon' but 
# here we only ever run one process anyway. 
USER daemon:daemon 

# Expose default HTTP connector port. 
EXPOSE 8080 

# Set volume mount points for installation and home directory. Changes to the 
# home directory needs to be persisted as well as parts of the installation 
# directory due to eg. logs. 
VOLUME ["/var/local/atlassian/jira", "/usr/local/atlassian/jira"] 

# Set the default working directory as the installation directory. 
WORKDIR ${JIRA_INSTALL} 

# Run Atlassian JIRA as a foreground process by default. 
CMD ["/usr/local/atlassian/jira/bin/start-jira.sh", "-fg"] 

泊塢窗圖像被成功地建立,但是,一旦容器啓動時,它在等待機器啓動,我要麼收到此錯誤:

/opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/packet_stream.rb:204:in `poll_next_packet': padding error, need 1475902204 block 16 (Net::SSH::Exception) 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/packet_stream.rb:90:in `next_packet' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:178:in `block in poll_message' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:173:in `loop' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:173:in `poll_message' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:460:in `dispatch_incoming_packets' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop' 
from /opt/vagrant/embedded/gems/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/communicators/ssh/communicator.rb:576:in `shell_execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/communicators/ssh/communicator.rb:215:in `block in execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/communicators/ssh/communicator.rb:312:in `connect' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/communicators/ssh/communicator.rb:209:in `execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/docker/executor/vagrant.rb:32:in `execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/docker/driver.rb:155:in `execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/docker/driver.rb:81:in `running?' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/docker/driver.rb:61:in `state' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/docker/provider.rb:156:in `state' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:480:in `state' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/wait_for_communicator.rb:26:in `block in call' 

或者,我只是得到,有一個超時,這意味着它花了太長時間來連接到本機的錯誤。

我的設置:

的Mac OSX 10.10.2 流浪1.7.2 的VirtualBox 4.3.26

我試圖消除vb.has_ssh,但沒有運氣無論是。

任何幫助表示讚賞!

回答

0

嘗試設置您的config.vm.boot_timeout值高於默認值!