2015-04-20 95 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值高于默认值!