This builds upon the exsting PcfDev Vagrant box by adding a Windows 2012R2 cell capable of hosting .NET 4.5 applications.
Add the following provisioner block before the existing provisioner block in the PcfDev Vagrantfile and before you initially bring up the box:
# Special provisioner to support Windows Cells
config.vm.provision "shell", run: "once" do |s|
s.inline = <<-SCRIPT
echo "- description: Windows Server 2012 R2" >> /var/vcap/jobs/cloud_controller_ng/config/stacks.yml
echo " name: windows2012R2" >> /var/vcap/jobs/cloud_controller_ng/config/stacks.yml
grep -rl "10.0.2.15" /var/vcap/data/jobs | xargs sed -i 's/10.0.2.15/#{local_public_ip}/g'
SCRIPT
end
This binds the CF services to the host only interface instead of the NAT'd interface.
Bring up the box according to the PcfDev Vagrant box instructions. Once you see "48 out of 49 running" for a few times, CTRL-C out of the process (this is a workaround for now).
Grab the Windows Cell Vagrantfile and place it another
directory separate from the PcfDev Vagrantfile. Bring up the Windows Vagrant box: vagrant up
. This
will download a public Windows 2012R2 Vagrant box and configure it as a cell in a working CF/Diego deployment.
- Target your new CF instance:
cf api api.local.pcfdev.io --skip-ssl-validation
- Login to CF:
cf login
(user: admin, pwd: admin) - Create a dev space:
cf create-space dev
- Target the new space:
cf target -o "pcfdev-org" -s "dev"
- Clone the .NET sample app and push it to CF
git clone https://github.com/cloudfoundry-incubator/NET-sample-app.git
cd NET-sample-app
cf push my-app -s windows2012R2 -b binary_buildpack -u none -p ./ViewEnvironment/
Once you see an App Started message, open your browser to http://my-app.local.pcfdev.io