Hello,

I have a Vagrantfile that looks like this:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're 
doing!
VAGRANTFILE_API_VERSION = "2"

ENV['VAGRANT_DEFAULT_PROVIDER'] ||= 'docker'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "postgres" do |postgres|
    postgres.vm.provider 'docker' do |d|
      d.image  = 'abevoelker/postgres'
      d.name   = 'my_app_postgres'
      d.expose = [5432]
    end
  end

  config.vm.define "web" do |web|
    web.vm.provider 'docker' do |d|
      d.image           = 'abevoelker/my_app'
      d.cmd             = ['/bin/bash', '-l']
      d.remains_running = false

      d.link('my_app_postgres:postgres')
    end

    web.vm.synced_folder "./", "/var/www"
  end
end

When I do a vagrant up, both images are ran, however web stops because bash 
finishes running right away since it is ran in the background:

$ vagrant status
Current machine states:

postgres                  running (docker)
web                       stopped (docker)

What I would really like is if Vagrant could do the equivalent of

docker run -i -t abevoelker/my_app /bin/bash -l

and give me an interactive bash prompt right in the foreground somehow, so 
that I can run various tasks that one does when in development.  I don't 
want to have to run every little command in a separate container or corrode 
my image with an SSH daemon for this to work.

Anyone have any ideas for this scenario?

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to