Skip to content
This repository was archived by the owner on Feb 27, 2018. It is now read-only.

Commit ed4748a

Browse files
committed
Merge pull request #82 from riobard/fix/config
Fix/config
2 parents 5918773 + af155a4 commit ed4748a

3 files changed

Lines changed: 52 additions & 18 deletions

File tree

README.md

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,54 @@ The `boot2docker-cli` binary reads configuration from `$BOOT2DOCKER_PROFILE`, or
8484
if not found, from `$BOOT2DOCKER_DIR/profile`. Currently you can configure
8585
the following options (undefined options take default values):
8686

87-
vbm=VBoxManage # path to VirtualBox management utility
88-
ssh=ssh # path to SSH client utility
89-
vm=boot2docker-vm # name of boot2docker virtual machine
90-
dir=$HOME/.boot2docker # path to boot2docker config directory
91-
iso=$BOOT2DOCKER_DIR/boot2docker.iso # path to boot2docker ISO image
92-
disksize=20000 # VM disk image size in MB
93-
memory=1024 # VM memory size in MB
94-
sshport=2022 # host port forwarding to port 22 in the VM
95-
dockerport=4243 # host port forwarding to port 4243 in the VM
96-
hostip=192.168.59.3 # host-only network host IP
97-
netmask=255.255.255.0 # host only network network mask
98-
dhcpip=192.168.59.99 # host-only network DHCP server IP
99-
dhcp=true # host-only network DHCP server enabled
100-
lowerip=192.168.59.103 # host-only network IP range lower bound
101-
upperip=192.168.59.254 # host-only network IP range upper bound
87+
```ini
88+
# Comments must be on their own lines; inline comments are not supported.
89+
90+
# path to VirtualBox management utility
91+
vbm=VBoxManage
92+
93+
# path to SSH client utility
94+
ssh=ssh
95+
96+
# name of boot2docker virtual machine
97+
vm=boot2docker-vm
98+
99+
# path to boot2docker config directory
100+
dir=$HOME/.boot2docker
101+
102+
# path to boot2docker ISO image
103+
iso=$BOOT2DOCKER_DIR/boot2docker.iso
104+
105+
# VM disk image size in MB
106+
disksize=20000
107+
108+
# VM memory size in MB
109+
memory=1024
110+
111+
# host port forwarding to port 22 in the VM
112+
sshport=2022
113+
114+
# host port forwarding to port 4243 in the VM
115+
dockerport=4243
116+
117+
# host-only network host IP
118+
hostip=192.168.59.3
119+
120+
# host only network network mask
121+
netmask=255.255.255.0
122+
123+
# host-only network DHCP server IP
124+
dhcpip=192.168.59.99
125+
126+
# host-only network DHCP server enabled
127+
dhcp=true
128+
129+
# host-only network IP range lower bound
130+
lowerip=192.168.59.103
131+
132+
# host-only network IP range upper bound
133+
upperip=192.168.59.254
134+
```
102135

103136
Environment variables of the form `$ENVVAR` in the profile will be expanded,
104137
even on Windows.
@@ -121,4 +154,4 @@ Guide](https://code.google.com/p/go-wiki/wiki/Style). In particular, you MUST
121154
run `gofmt` before committing. We suggest you run `go tool vet -all .` as well.
122155

123156
Please rebase the upstream in your fork in order to keep the commit history
124-
tidy.
157+
tidy.

config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ func readProfile(filename string) ([]string, error) {
154154
for s.Scan() {
155155
ln++
156156
line := strings.TrimSpace(s.Text())
157-
if strings.HasPrefix(line, "#") || strings.HasPrefix(line, ";") {
158-
// Ignore comment lines starting with # or ;
157+
if line == "" || strings.HasPrefix(line, "#") || strings.HasPrefix(line, ";") {
158+
// Ignore empty lines and comment lines starting with # or ;
159159
continue
160160
}
161161
res := reFlagLine.FindStringSubmatch(line)

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func main() {
2222
func run() int {
2323
flags, err := config()
2424
if err != nil {
25+
errf("config error: %v\n", err)
2526
return 1
2627
}
2728

0 commit comments

Comments
 (0)