vagrant特性——基于docker开发环境(docker和vagrant的结合)-4-简单例子-有问题

运行一个十分简单的例子:

Vagrant.configure(2) do |config|
  config.vm.provider "docker" do |d|
    d.image = "hello-world"
    d.has_ssh = true
  end

  # use shell and other provisioners as usual
  config.vm.provision "shell", inline: "echo 'hello docker!'"
end

按照前面学的知识应该是能够跑通的,但是就是会一直卡在:

userdeMacBook-Pro:test-1 user$ vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Fixed port collision for 22 => 2222. Now on port 2201.
==> default: Creating the container...
    default:   Name: test-1_default_1545915326
    default:  Image: hello-world
    default: Volume: /Users/user/test-1:/vagrant
    default:   Port: 127.0.0.1:2201:22
    default:  
    default: Container created: 1243ad705a6cd5d4
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

然后容器也没有运行起来,这是为什么呢,有知道原因的小伙伴希望能够告知,还运行了一些其他的例子,感觉都没有真正的运行起来

转载于:https://www.cnblogs.com/wanghui-garcia/p/10187216.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值