使用 Vagrant 配置虚拟机时转发 Docker 容器的输出

使用 Vagrant 配置虚拟机时转发 Docker 容器的输出

是否有任何选项可以查看运行容器的 Vagrant 的 Docker 配置程序的输出?

我的Vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.define "barge"
  config.vm.box = "ailispaw/barge"

  config.vm.provision :docker do |d|
    d.run "hello-world",
      image: "hello-world",
      daemonize: false,
      restart: 'no',
      verbosity: 'vvv' <<< DOESN'T WORK AS WITH ANSIBLE :(
  end
end

跑步

vagrant provision--debug

没有提供来自 hello-world 容器的实际输出:

 INFO interface: info: Starting Docker containers...
 INFO interface: info: ==> barge: Starting Docker containers...
==> barge: Starting Docker containers...
 INFO interface: info: -- Container: hello-world
 INFO interface: info: ==> barge: -- Container: hello-world
==> barge: -- Container: hello-world
 INFO ssh: Execute: mkdir -p /var/lib/vagrant/cids (sudo=true)
 INFO ssh: Execute: sudo docker ps -q -a --no-trunc | grep -wFq $(cat /var/lib/vagrant/cids/fbb969117edfa916b86dfb67fd11decf1e336df0) (sudo=false)
 INFO ssh: Execute: docker inspect --format='{{.Image}}' hello-world | grep $(docker images -q hello-world) (sudo=false)
 INFO ssh: Execute: sudo docker ps -q --no-trunc | grep -wFq $(cat /var/lib/vagrant/cids/fbb969117edfa916b86dfb67fd11decf1e336df0) (sudo=false)
 INFO ssh: Execute: docker start $(cat /var/lib/vagrant/cids/fbb969117edfa916b86dfb67fd11decf1e336df0) (sudo=true)

相关内容