Skip to content

Instantly share code, notes, and snippets.

@jdolitsky
Created March 13, 2014 08:29
Show Gist options
  • Save jdolitsky/9524334 to your computer and use it in GitHub Desktop.
Save jdolitsky/9524334 to your computer and use it in GitHub Desktop.
Vagrant, Docker, & Jenkins
# Creates a Jenkins environment at http://localhost:3000
VAGRANTFILE_API_VERSION = 2
GUEST_JENKINS_PORT = 8080
HOST_JENKINS_PORT = 3000
JENKINS_DOCKER_IMAGE = "aespinosa/jenkins"
VM_BOX_NAME = "precise64"
VM_BOX_URL = "http://files.vagrantup.com/precise64.box"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = VM_BOX_NAME
config.vm.box_url = VM_BOX_URL
config.vm.network "forwarded_port",
guest: GUEST_JENKINS_PORT,
host: HOST_JENKINS_PORT
config.vm.provision "docker" do |d|
d.pull_images JENKINS_DOCKER_IMAGE
d.run JENKINS_DOCKER_IMAGE,
args: "-p #{GUEST_JENKINS_PORT}:#{GUEST_JENKINS_PORT}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment