Docker the Vagrant Way

Using Vagrant to Orchestrate Docker Containers

Vagrant vs the World

Why Vagrant

Prerequisites

The Problem Challenge

Getting Started Code

Implementation Notes

Automated Verification

InSpec Script

Getting InSpec

gem install inspec
gem
install inspec-bin

Running the Script

inspec exec \
-t ssh://vagrant@127.0.0.1 \
-i .vagrant/machines/default/virtualbox/private_key \
-p 2222 \
container_test.rb
curl -O https://gist.githubusercontent.com/darkn3rd/44cf4c8bdbb9f063bba399e9e40c7189/raw/ec8698425d434abac05c5f76a612cfc9aa9e95dc/inspec_helper
chmod +x inspec_helper
inspec exec $(./inspec_helper) container_test.rb

Testing with WORDPRESS_PORT

echo "port: $WORDPRESS_PORT" > attributes.yml
inspec exec $(./inspec_helper) tests --attrs=attributes.yml

Further Reading

Detailed Requirement Document

Previous Shell Solution

References

Final Thoughts

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Joaquín Menchaca (智裕)

Linux NinjaPants Automation Engineering Mutant — exploring DevOps, o11y, k8s, progressive deployment (ci/cd), cloud native infra, infra as code