Skip to content

Instantly share code, notes, and snippets.

@jamescarr
Created May 19, 2014 18:20
Show Gist options
  • Select an option

  • Save jamescarr/1bf08279e7b2eb476227 to your computer and use it in GitHub Desktop.

Select an option

Save jamescarr/1bf08279e7b2eb476227 to your computer and use it in GitHub Desktop.
Vagrant.configure("2") do |config|
config.vm.provider "docker" do |d|
d.image = "orchardup/jenkins"
d.ports = ["8080:8080"]
end
end
@jamescarr
Copy link
Copy Markdown
Author

Vagrant 1.6.2
VirtualBox 4.3.10

@jamescarr
Copy link
Copy Markdown
Author

jamescarr@James-MacBook-Air: ~/Projects/jenkins
$ vagrant up --provider=docker [13:37:08]
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
default: Vagrant will now create or start a local VM to act as the Docker
default: host. You'll see the output of the vagrant up for this VM below.
default:
default: Importing base box 'mitchellh/boot2docker'...
default: Matching MAC address for NAT networking...
default: Checking if box 'mitchellh/boot2docker' is up to date...
default: Setting the name of the VM: docker-host_default_1400524657807_53033
default: Fixed port collision for 22 => 2222. Now on port 2200.
default: Clearing any previously set network interfaces...
default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Forwarding ports...
default: 4243 => 4243 (adapter 1)
default: 22 => 2200 (adapter 1)
default: Running 'pre-boot' VM customizations...
default: Booting VM...
default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: docker
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Machine booted and ready!
==> default: Syncing folders to the host VM...
default: Installing rsync to the VM...
default: Rsyncing folder: /Users/jamescarr/Projects/jenkins/ => /var/lib/docker/docker_1400524677_71664
==> default: Warning: When using a remote Docker host, forwarded ports will NOT be
==> default: immediately available on your machine. They will still be forwarded on
==> default: the remote machine, however, so if you have a way to access the remote
==> default: machine, then you should be able to access those ports there. This is
==> default: not an error, it is only an informational message.
==> default: Creating the container...
default: Name: jenkins_default_1400524712
default: Image: orchardup/jenkins
default: Volume: /var/lib/docker/docker_1400524677_71664:/vagrant
default: Port: 8080:8080
default: Port: 2222:22

@jamescarr
Copy link
Copy Markdown
Author

I also tried with this:

Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "192.168.50.44"
  config.vm.network :forwarded_port, guest: 8080, host: 8080

  config.vm.provider "docker" do |d|
    d.image = "orchardup/jenkins"
    d.ports = ["8080:8080"]
  end
end

curl to both http://localhost:8080 and http://192.168.50.44:8080 return nothing.

Cannot be related to dockerfiles as I have tried others. What gives?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment