This repository was archived by the owner on Jan 30, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerHostVagrantfile
More file actions
109 lines (90 loc) · 4.22 KB
/
DockerHostVagrantfile
File metadata and controls
109 lines (90 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version ">= 1.6.0"
Vagrant.configure("2") do |config|
# Install docker on host VM
config.vm.provision "docker"
# Kill SSH so Vagrant reconnects and has Docker commands on $PATH
config.vm.provision "shell", inline:
"ps aux | grep 'sshd:' | awk '{print $2}' | xargs kill"
config.vm.provision "shell", inline:
"sudo mkdir -p /shared; sudo chown vagrant:vagrant /shared; sudo chmod g+rws /shared"
############ Networking ############
# This makes the VM appear as a host with the desinated IP to the local
# machine. (e.g. this allows accessing http services running within the
# VM from the local OS like http://10.11.8.11/whatever). This MUST be
# enabled if the VM is to shared folders to the native machine via NFS
# or SMB.
config.vm.network "private_network", ip: "10.11.8.11"
# This forwards certain ports on the VM to the local host, so that they
# appear to be originating from the local host (e.g. this allows accessing
# http services from the local OS like http://localhost:8080/whatever)
config.vm.network "forwarded_port",
guest: 8080, host: 8080
config.vm.network "forwarded_port",
guest: 8181, host: 8181
########## File sharing ################
# Virtualbox shared folders
#
# These specify LOCAL (host OS) folders to serve as the primary storage
# location for logs, configuration, and packages. The VM then mounts these
# to read from or write to. If you would like the primary storage location
# to be within the VM, comment these out.
#
# Note: Fedora storage is incompatible with Virtualbox shared folders.
# Therefore, when using Virtualbox, the Fedora data directories cannot be
# local to the host OS. Thus, we specify jetty, karaf, and package ingest
# singly here, but NOT fedora-data. NFS does not have this limitation,
# so on hosts that support NFS (Linux, Mac), you may want to use an
# alternate configuration based on NFS (see below)
#config.vm.synced_folder "/shared/package-ingest", "/shared/package-ingest",
# mount_options: ["dmode=777", "fmode=666"]
#config.vm.synced_folder "/shared/karaf", "/shared/karaf",
# mount_options: ["dmode=777", "fmode=666"]
#config.vm.synced_folder "/shared/jetty", "/shared/jetty",
# mount_options: ["dmode=777", "fmode=666"]
# NFS or SMB shared folders
#
# Alternate NFS or SMB configuration of LOCAL folders shared with the VM.
# This causes your local machine to serve as an NFS or SMB server, sharing
# the contents of the specified directory with the VM. *nix and MacOS
# hosts must use NFS, Windows must use SMB. Windows hosts must have
# PowerShell 3 installed
#
# This option should provide better performance and reliability than
# Virtualbox file shares, but may have security implications as it turns your
# local host into a file server.
#
# See: https://www.vagrantup.com/docs/synced-folders/nfs.html
# See: https://www.vagrantup.com/docs/synced-folders/smb.html
#
# To use this, un-comment the below lines, and comment out the
# Virtualbox shared folders lines above.
#if Vagrant::Util::Platform.windows?
# config.vm.synced_folder "/shared", "/shared", type: "smb"
#else
# config.vm.synced_folder "/shared", "/shared",
# :nfs => true,
# :mount_options => ['rw']
#end
# VM hosted folders
#
# This causes the VM to share the entire "/shared" directory via SMB
# (Windows file shares). If you mount the share on your local machine, you
# can read or write to it. This can be used regardless of whether the
# contents of /shared primarily reside on the local host OS (and are
# shared with the VM), or if the contents of /shared are hosted on the VM
# and shared with the local host.
config.vm.provision "shell", path: "scripts/samba.sh"
# This specifies the image to run in the VM
config.vm.define "dockerhost"
config.vm.box = "ubuntu/trusty64"
# This specifies that we want virtualbox to run the VM image, with
# a given amount of RAM.
config.vm.provider :virtualbox do |vb|
vb.memory = 2048
vb.name = "dockerhost"
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
end