Git Product home page Git Product logo

boot2docker-cli's Introduction

DEPRECATED

Boot2Docker is officially deprecated and unmaintained. It is recommended that users transition from Boot2Docker over to Docker Desktop instead (especially with the new WSL2 backend, which supports Windows 10 Home).

These days there are a lot of tools designed to help spin up environments, and it's relatively easy to get something up and running with Docker installed with minimal effort.

Boot2Docker

Build Status

Boot2Docker is a lightweight Linux distribution made specifically to run Docker containers. It runs completely from RAM, is a ~45MB download and boots quickly.

Features

  • Recent Linux Kernel, Docker pre-installed and ready-to-use
  • VM guest additions (VirtualBox, Parallels, VMware, XenServer)
  • Container persistence via disk automount on /var/lib/docker
  • SSH keys persistence via disk automount

Note: Boot2Docker uses port 2376, the registered IANA Docker TLS port

Caveat Emptor

Boot2Docker is designed and tuned for development. Using it for any kind of production workloads is highly discouraged.

Installation

Installation should be performed via Docker Toolbox which installs Docker Machine, the Boot2Docker VM, and other necessary tools.

The ISO can be downloaded here.

How to use

Boot2Docker is used via Docker Machine (installed as part of Docker Toolbox) which leverages VirtualBox's VBoxManage to initialise, start, stop and delete the VM right from the command line.

More information

See Frequently asked questions for more details.

Boot script log

The bootup script output is logged to /boot.log, so you can see (and potentially debug) what happens. Note that this is not persistent between boots because we're logging from before the persistence partition is mounted (and it may not exist at all).

Docker daemon options

If you need to customize the options used to start the Docker daemon, you can do so by adding entries to the /var/lib/boot2docker/profile file on the persistent partition inside the Boot2Docker virtual machine. Then restart the daemon.

The following example will enable core dumps inside containers, but you can specify any other options you may need.

docker-machine ssh default -t sudo vi /var/lib/boot2docker/profile
# Add something like:
#     EXTRA_ARGS="--default-ulimit core=-1"
docker-machine restart default

Installing secure Registry certificates

As discussed in the Docker Engine documentation certificates should be placed at /etc/docker/certs.d/hostname/ca.crt where hostname is your Registry server's hostname.

docker-machine scp certfile default:ca.crt
docker-machine ssh default
sudo mv ~/ca.crt /etc/docker/certs.d/hostname/ca.crt
exit
docker-machine restart

Alternatively the older Boot2Docker method can be used and you can add your Registry server's public certificate (in .pem or .crt format) into the /var/lib/boot2docker/certs/ directory, and Boot2Docker will automatically load it from the persistence partition at boot.

You may need to add several certificates (as separate .pem or .crt files) to this directory, depending on the CA signing chain used for your certificate.

Insecure Registry

As of Docker version 1.3.1, if your registry doesn't support HTTPS, you must add it as an insecure registry.

$ docker-machine ssh default "echo $'EXTRA_ARGS=\"--insecure-registry <YOUR INSECURE HOST>\"' | sudo tee -a /var/lib/boot2docker/profile && sudo /etc/init.d/docker restart"

then you should be able to do a docker push/pull.

Running behind a VPN (Cisco AnyConnect, etc)

So sometimes if you are behind a VPN, you'll get an i/o timeout error. The current work around is to forward the port in the boot2docker-vm.

If you get an error like the following:

Sending build context to Docker daemon
2014/11/19 13:53:33 Post https://192.168.59.103:2376/v1.15/build?rm=1&t=your-tag: dial tcp 192.168.59.103:2376: i/o timeout

That means you have to forward port 2376, which can be done like so:

  • Open VirtualBox
  • Open Settings > Network for your 'default' VM
  • Select the adapter that is 'Attached To': 'NAT' and click 'Port Forwarding'.
  • Add a new rule:
    • Protocol: TCP
    • Host IP: 127.0.0.1
    • Host Port: 5555
    • Guest Port: 2376
  • Set DOCKER_HOST to 'tcp://127.0.0.1:5555'

SSH into VM

$ docker-machine ssh default

Docker Machine auto logs in using the generated SSH key, but if you want to SSH into the machine manually (or you're not using a Docker Machine managed VM), the credentials are:

user: docker
pass: tcuser

Persist data

Boot2docker uses Tiny Core Linux, which runs from RAM and so does not persist filesystem changes by default.

When you run docker-machine, the tool auto-creates a disk that will be automounted and used to persist your docker data in /var/lib/docker and /var/lib/boot2docker. This virtual disk will be removed when you run docker-machine delete default. It will also persist the SSH keys of the machine. Changes outside of these directories will be lost after powering down or restarting the VM.

If you are not using the Docker Machine management tool, you can create an ext4 formatted partition with the label boot2docker-data (mkfs.ext4 -L boot2docker-data /dev/sdX5) to your VM or host, and Boot2Docker will automount it on /mnt/sdX and then softlink /mnt/sdX/var/lib/docker to /var/lib/docker.

boot2docker-cli's People

Contributors

aanand avatar aheissenberger avatar ahmetb avatar bfirsh avatar daghack avatar daniellockard avatar databus23 avatar doug avatar douglascamata avatar gmlewis avatar jgeiger avatar jonseymour avatar lalyos avatar mattrobenolt avatar mhubig avatar michaelneale avatar michaelsauter avatar mohitsoni avatar msabramo avatar nathanleclaire avatar rdsubhas avatar riobard avatar shalecraig avatar shaundon avatar steeve avatar svendowideit avatar tianon avatar waltarix avatar zarko-tg avatar zeeyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boot2docker-cli's Issues

boot2docker may fail silently, returning status code 1 with no output

I tried creating my own ~/.boot2docker/profile configuration file. Like a good citizen I ended it with a newline. Unfortunately, from then on boot2docker-cli returned an exit status of 1 with no other output about what the issue was.

I had to place a fmt.Print(err) before the return 1 in run() in main.go to find out it's because of a parse error.

It turns out that there are a lot of places in config.go where there's no error logging and things like this can just slip by without being reported to the user.

boot2docker init fails if there's no ~/.boot2docker directory

(The boot2docker-cli program should probably check for the existence of the .boot2docker directory and create it if it does not exist.)

Example of failure on OSX:

$ boot2docker init
2014/02/23 13:05:26 Creating VM boot2docker-vm...
Virtual machine 'boot2docker-vm' is created and registered.
UUID: c94197e5-3d80-477a-8d8a-cb64e4e8625e
Settings file: '/Users/jack/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox'
2014/02/23 13:05:26 Setting VM networking...
2014/02/23 13:05:26 Port forwarding [ssh]: host tcp://127.0.0.1:2022 --> guest tcp://0.0.0.0:22
2014/02/23 13:05:26 Port forwarding [docker]: host tcp://127.0.0.1:4243 --> guest tcp://0.0.0.0:4243
2014/02/23 13:05:26 Downloading boot2docker ISO image...
2014/02/23 13:05:27 Latest release is v0.6.0
2014/02/23 13:05:29 Failed to download ISO image: open /Users/jack/.boot2docker/boot2docker.iso.download: no such file or directory

running from cmd.exe fails.

C:\Program Files\Boot2Docker>.\boot2docker-cli.exe version
open C:\Users\svend_000\AppData\Roaming\boot2docker\profile: The system cannot f
ind the path specified.

Continuous building with Wercker

Wercker is currently still in beta but I use it for almost all my projects as CI provider and even for automatic deployment. It's free at the moment and afaik will always be free for open source projects.

It allows to build docker images and run commands on them. We can even export the docker image.

So my propose would be to use Wercker for continuous building of the binary files.

boot2docker-cli fails on the second time

svend_000@T440S ~
$ ./boot2docker-cli.exe download
2014/03/10 15:15:26 Downloading boot2docker ISO image...
2014/03/10 15:15:28 Latest release is v0.6.0
2014/03/10 15:17:03 Failed to download ISO image: rename c:\Users\svend_000\.boot2docker\boot2docker.iso.downl
oad c:\Users\svend_000\.boot2docker\boot2docker.iso: Cannot create a file when that file already exists.

get last release / OSX / x509: failed to load system roots and no roots provided

To use "https"/TLS the code needs to be compiled with CGO_ENABLE to access the keychain on OSX. This is not possible with cross compiling.

boot2docker/boot2docker download
2014/02/24 10:26:11 Downloading boot2docker ISO image...
2014/02/24 10:26:11 Failed to get latest release: Get https://api.github.com/repos/boot2docker/boot2docker/releases: x509: failed to load system roots and no roots provided

more info:
https://groups.google.com/forum/#!topic/golang-nuts/gyL_jeOyxQA

the github url is only avaible with https :-(

Use boot2docker-cli as Homebrew source

Can someone submit a PR for homebrew to use boot2docker-cli in favor of the old shell version? Would be way more convenient for new users to install boot2docker ๐Ÿ‘

boot2docker-cli ssh fails

                "-o", "StrictHostKeyChecking=no",
                "-o", "UserKnownHostsFile=/dev/null",
                "-p", fmt.Sprintf("%d", B2D.SSHPort),
                "docker@localhost",
        ); err != nil {
                logf("%s", err)
sven:~/src/docker/boot2docker-cli (master *)$ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no docker@localhost -p 2022
Warning: Permanently added '[localhost]:2022' (ECDSA) to the list of known hosts.
docker@localhost's password:
                        ##        .
                  ## ## ##       ==
               ## ## ## ##      ===
           /""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
           \______ o          __/
             \    \        __/
              \____\______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
boot2docker: 0.8.0
docker@boot2docker:~$ Connection to localhost closed.
sven:~/src/docker/boot2docker-cli (master *)$ ./boot2docker-cli ssh
docker@localhost's password:
2014/04/09 11:13:00 exit status 1
sven:~/src/docker/boot2docker-cli (master *)$ ./boot2docker-cli version
Client version: v0.7.0-dev
Git commit: d88b216

IP address of boot2docker-vm on host-only network is unpredictable

My boot2docker-vm currently has IP address 192.168.59.107 on the host-only network, and I'm able to successfully talk to it from the (OS X) host.

However, if I recreate the VM, I'm likely to get a different IP address. This makes it difficult to (for example) write test scripts, or configure a "local docker" alias in /etc/hosts.

Clarification on Port Forwarding

I'm having an issue getting to the ports in my containers.

I'm on Mac OS X, Mavericks. Using the 0.8.0 boot2docker-cli (408532a).

I've used a phusion/passenger-ruby21:0.9.9 image, with a docker file:

FROM phusion/passenger-ruby21:0.9.9

# Set correct environment variables.
ENV HOME /root

# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]

ADD docker/id_dsa.pub /tmp/your_key
RUN cat /tmp/your_key >> /root/.ssh/authorized_keys && rm -f /tmp/your_key
RUN chmod 0600 /root/.ssh/authorized_keys

EXPOSE 22

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

This works and I can connect from the docker VM using SSH. I see VirtualBox has the NAT network and the Host only network. So, here's my confusion as I can't SSH into the container from outside of the docker VM.

My IP: 172.20.10.2
The docker VM IPs:
docker0: 172.17.42.1
eth0: 10.0.2.15
eth1: 192.168.59.103

The container IP: 172.17.0.2

If I traceroute to the container IP from my terminal, it goes out onto the Internet looking for it and fails. I'm no expert, but is my Airport IP messing this up in some way? It should go straight through the host only network to the container normally, right?

EDIT

VirtualBox says there is 1 host only network, and the adapter is 192.168.59.3, with the DHCP (192.168.59.99) serving 192.168.59.103...192.168.59.254. Should I have a DHCP client running and that's why it fails?

boot2docker-cli init fails on Windows

I'm trying to run "init" on Windows but it is failing:
$ boot2docker-cli init
2014/03/07 12:59:17 Creating VM boot2docker-vm...
Virtual machine 'boot2docker-vm' is created and registered.
UUID: a6dae4c8-1f32-47ec-861b-d4f175f5c16f
Settings file: 'C:\Users\gmlewis\VirtualBox VMs\boot2docker-vm\boot2docker-vm.vbox'
2014/03/07 12:59:17 Setting VM networking...
2014/03/07 12:59:18 Port forwarding [ssh]: host tcp://127.0.0.1:2022 --> guest tcp://0.0.0.0:22
2014/03/07 12:59:18 Port forwarding [docker]: host tcp://127.0.0.1:4243 --> guest tcp://0.0.0.0:4243
2014/03/07 12:59:18 Setting VM host-only networking
Creating a new hostonly network interface
2014/03/07 12:59:25 Adding VM host-only networking interface
VBoxManage.exe: error: Empty or null host only interface name is not valid
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component NetworkAdapter, interface INetworkAdapter, callee IUnknown
VBoxManage.exe: error: Context: "COMSETTER(HostOnlyInterface)(Bstr(ValueUnion.psz).raw())" at line 1485 of file VBoxManageModifyVM.cpp
2014/03/07 12:59:25 Failed to modify boot2docker-vm: exit status 1

boot2docker-cli ignores ~/.boot2docker/profile on Linux

While attempting to debug issue #48 I tweaked my ~/.boot2docker/profile on Linux as so:
VM_NAME=boot2docker-vm22
VBM=VBoxManage

DOCKER_PORT=4243
SSH_HOST_PORT=2022

VM_DISK_SIZE=40000
VM_MEM=1024

When I ran "boot2docker-cli -v init", it created a virtualbox named "boot2docker-vm", not "boot2docker-vm22" as expected. Note also that the disk size is ignored.

Here is the output of -v:
$ boot2docker-cli -v init
2014/03/10 13:01:01 Creating VM boot2docker-vm...
2014/03/10 13:01:01 executing: VBoxManage createvm --name boot2docker-vm --register
Virtual machine 'boot2docker-vm' is created and registered.
UUID: 461ae5c3-0c40-4675-810b-1870b3495346
Settings file: '/usr/local/google/home/gmlewis/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox'
2014/03/10 13:01:01 executing: VBoxManage modifyvm boot2docker-vm --ostype Linux26_64 --cpus 12 --memory 1024 --rtcuseutc on --acpi on --ioapic on --hpet on --hwvirtex on --vtxvpid on --largepages on --nestedpaging on --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --boot1 dvd
2014/03/10 13:01:02 Setting VM networking...
2014/03/10 13:01:02 executing: VBoxManage modifyvm boot2docker-vm --nic1 nat --nictype1 virtio --cableconnected1 on
2014/03/10 13:01:02 executing: VBoxManage modifyvm boot2docker-vm --natpf1 ssh,tcp,127.0.0.1,2022,,22 --natpf1 docker,tcp,127.0.0.1,4243,,4243
2014/03/10 13:01:03 Port forwarding [ssh]: host tcp://127.0.0.1:2022 --> guest tcp://0.0.0.0:22
2014/03/10 13:01:03 Port forwarding [docker]: host tcp://127.0.0.1:4243 --> guest tcp://0.0.0.0:4243
2014/03/10 13:01:03 Setting VM host-only networking
Creating a new hostonly network interface
2014/03/10 13:01:03 Adding VM host-only networking interface vboxnet4
2014/03/10 13:01:03 executing: VBoxManage modifyvm boot2docker-vm --nic2 hostonly --nictype2 virtio --cableconnected2 on --hostonlyadapter2 vboxnet4
2014/03/10 13:01:04 Setting VM storage...
2014/03/10 13:01:04 executing: VBoxManage storagectl boot2docker-vm --name SATA --add sata --hostiocache on
2014/03/10 13:01:04 executing: VBoxManage storageattach boot2docker-vm --storagectl SATA --port 0 --device 0 --type dvddrive --medium /usr/local/google/home/gmlewis/.boot2docker/boot2docker.iso
Converting from raw image file="stdin" to file="/usr/local/google/home/gmlewis/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
2014/03/10 13:01:25 executing: VBoxManage storageattach boot2docker-vm --storagectl SATA --port 1 --device 0 --type hdd --medium /usr/local/google/home/gmlewis/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vmdk
2014/03/10 13:01:25 Done. Type boot2docker-cli up to start the VM.

Cannot use boot2docker ssh to run a command

The script version of boot2docker allows something like boot2docker ssh <cmd> which is very handy on Windows to run docker commands (in fact I have a bash script called docker that does boot2docker ssh "docker $*").

Unfortunately it seems that boot2docker-cli interprets anything after the ssh as a machine name and not a command. Not sure of the reason for the change, but it doesn't seem right (having behavior consistent with ssh itself would seem preferable).

VM created by init does not have DNS set up correctly

I tried using the current master with the latest boot2docker ISO but the networking is not being initialized correctly. I tried to pull down a docker image but was told the host could not resolve. When I added nameserver 8.8.8.8 to my /etc/resolv.conf I was able to connect.

panic: interface conversion: error is *exec.ExitError, not *exec.Error

I am testing an samba-server data volume container, and have the share mounted - so this may well be related..

svend_000@T440S ~/.boot2docker
$ ./boot2docker-cli.exe stop
2014/03/11 15:34:23 Shutting down VM "boot2docker-vm"...
panic: interface conversion: error is *exec.ExitError, not *exec.Error

goroutine 1 [running]:
runtime.panic(0x676980, 0xc084060a80)
        /usr/local/go/src/pkg/runtime/panic.c:266 +0xc8
main.status(0x6da0b0, 0xe, 0x6cbf20, 0x7)
        /go/src/github.com/boot2docker/boot2docker-cli/vbm.go:130 +0x461
main.cmdStop(0xc0840021e0)
        /go/src/github.com/boot2docker/boot2docker-cli/cmds.go:360 +0x6fc
main.run(0x40dc46)
        /go/src/github.com/boot2docker/boot2docker-cli/main.go:45 +0x3cf
main.main()
        /go/src/github.com/boot2docker/boot2docker-cli/main.go:23 +0x21

Connecting to host from container

For some things, it doesn't make sense to put them in containers ie. database(s). For this, it's helpful to connect to the host network interface from the container.

With docker on linux, you can connect to the host on: 172.17.42.1

However, boot2docker can only connect from ip 10.0.2.2

I've tried playing with different config options, but this still seems to be the only IP the host will respond on. Perhaps, this should be bootstrapped so virtualbox forwards requests to ip 172.17.42.1 to the host.

Example profile does not parse

The sample profile from README.md causes errors from the lexer:

$ go version
go version go1.2.2 darwin/amd64
$ git rev-parse --short HEAD
e6c80c5
$ make -j4 darwin
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.Version v0.8.0 -X main.GitSHA e6c80c5" -o boot2docker-cli-v0.8.0-darwin-amd64
$ ./boot2docker-cli-v0.8.0-darwin-amd64 config
config error: Near line 31, key '': Near line 31: Expected a top-level item to end with a new line, comment or EOF, but got '.' instead.

It appears IP addresses must be quoted strings (hostip="192.168.59.3") rather than naked values as in the sample. Changing these yields a different error:

$ ./boot2docker-cli-v0.8.0-darwin-amd64 config
panic: reflect: call of reflect.Value.SetInt on uint16 Value

goroutine 1 [running]:
runtime.panic(0x280fa0, 0xc21000ab20)
    /usr/local/Cellar/go/1.2.2/libexec/src/pkg/runtime/panic.c:266 +0xb6
reflect.Value.SetInt(0x2262e0, 0x5eacb8, 0x96, 0x7e6)
    /usr/local/Cellar/go/1.2.2/libexec/src/pkg/reflect/value.go:1457 +0xb7
github.com/BurntSushi/toml.unifyInt(0x225bc0, 0x7e6, 0x2262e0, 0x5eacb8, 0x96, ...)
    /Users/mikey/go/src/github.com/BurntSushi/toml/decode.go:384 +0x4c4
github.com/BurntSushi/toml.unify(0x225bc0, 0x7e6, 0x2262e0, 0x5eacb8, 0x96, ...)
    /Users/mikey/go/src/github.com/BurntSushi/toml/decode.go:171 +0x262
github.com/BurntSushi/toml.unifyStruct(0x224180, 0xc21001eed0, 0x2d24a0, 0x5eac20, 0x196, ...)
    /Users/mikey/go/src/github.com/BurntSushi/toml/decode.go:241 +0x50f
github.com/BurntSushi/toml.unify(0x224180, 0xc21001eed0, 0x2d24a0, 0x5eac20, 0x196, ...)
    /Users/mikey/go/src/github.com/BurntSushi/toml/decode.go:183 +0x804
github.com/BurntSushi/toml.Decode(0xc210048400, 0x399, 0x2123c0, 0x5eac20, 0x399, ...)
    /Users/mikey/go/src/github.com/BurntSushi/toml/decode.go:121 +0x107
github.com/BurntSushi/toml.DecodeFile(0xc21001ee40, 0x21, 0x2123c0, 0x5eac20, 0x0, ...)
    /Users/mikey/go/src/github.com/BurntSushi/toml/decode.go:131 +0x100
main.config(0x10000d4, 0xc21000fc80, 0x0)
    /Users/mikey/git/boot2docker-cli/config.go:152 +0xcc4
main.run(0xc21000fc80)
    /Users/mikey/git/boot2docker-cli/main.go:23 +0x26
main.main()
    /Users/mikey/git/boot2docker-cli/main.go:18 +0x1e

profile used in last logs:

# Comments must be on their own lines; inline comments are not supported.

# path to VirtualBox management utility
vbm="VBoxManage"

# path to SSH client utility
ssh="ssh"

# name of boot2docker virtual machine
vm="boot2docker-vm"

# path to boot2docker config directory
dir="$HOME/.boot2docker"

# path to boot2docker ISO image
iso="$BOOT2DOCKER_DIR/boot2docker.iso"

# VM disk image size in MB
disksize=20000

# VM memory size in MB
memory=1024

# host port forwarding to port 22 in the VM
sshport=2022

# host port forwarding to port 4243 in the VM
dockerport=4243

# host-only network host IP
hostip="192.168.59.3"

# host only network network mask
netmask="255.255.255.0"

# host-only network DHCP server IP
dhcpip="192.168.59.99"

# host-only network DHCP server enabled
dhcp=true

# host-only network IP range lower bound
lowerip="192.168.59.103"

# host-only network IP range upper bound
upperip="192.168.59.254"

installer

can we work out what minimal set of MSYS tools will make life easier (ie, ssh) and throw them into the installer?

ATM my windows box has MSYS-Git installed, so i have lots of fun toys

multiple boot2docker VM configuration

Or do you just have one? I'm asking this because I'm thinking about the placement of the VMDK disk image. If we assume people will have more than one boot2docker VMs, it is a bit weird to have a single VMDK disk image located in ~/.boot2docker/ instead of having it inside the VirtualBox VM folder. It will probably impact the design of config/profile too.

Maturity hint

Please mention in the readme the state of the current maturity, so people know whether the can already use the go port.

init under windows fails to create the vm if there is an inaccessible vm

I am getting the following output when running boot2docker init:

D:\dev\Virtuals>boot2docker-cli-v0.8.0-windows-amd64.exe init -v
2014/05/14 00:15:56 Creating VM boot2docker-vm...
2014/05/14 00:15:56 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe list vms
2014/05/14 00:15:57 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe showvminfo Work --machinereadable
2014/05/14 00:15:58 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe showvminfo Xubuntu --machinereadable
2014/05/14 00:15:58 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe showvminfo <inaccessible> --machinereadable
2014/05/14 00:15:59 Failed to create VM "boot2docker-vm": machine does not exist

Removing the inaccessible VM (Completely unrelated to docker) fixes the problem.

download failure

svend_000@T440S /c/Program Files/Boot2Docker
$ ./boot2docker-cli.exe download
2014/04/09 10:29:12 Downloading boot2docker ISO image...
2014/04/09 10:29:13 Latest release is v0.8.0
2014/04/09 10:30:31 Failed to download ISO image: rename c:\Users\svend_000\.boo
t2docker\boot2docker.iso.download c:\Users\svend_000\.boot2docker\boot2docker.is
o: Cannot create a file when that file already exists.

Versioning scheme

Since the cli is in its own repo now we have to decide the versioning scheme. I propose we separate the version of the OS and the version of the cli, so the two can release independently. Given the current situation, I'm expecting the cli to have more frequent releases to cover bugs of the Go port on supported platforms.

delete twice has bad error

svend_000@T440S ~/.boot2docker
$ ./boot2docker-cli.exe delete
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

svend_000@T440S ~/.boot2docker
$ ./boot2docker-cli.exe delete
2014/03/11 14:33:38 VM "boot2docker-vm" is not registered.
VBoxManage.exe: error: Could not find a registered machine named 'boot2docker-vm'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVi
rtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(VMName).raw(), machine.asOutParam())" at line 154 of file VB
oxManageMisc.cpp
2014/03/11 14:33:38 Failed to delete VM "boot2docker-vm": exit status 1

boot2docker-cli start on windows hangs

it start the vm fine, but the ssh detection won't work.

svend_000@T440S ~
$ boot2docker-cli.exe up
2014/02/26 17:12:00 Starting boot2docker-vm...
Waiting for VM "boot2docker-vm" to power on...
VM "boot2docker-vm" has been successfully started.
2014/02/26 17:12:00 Waiting for SSH server to start...

Handling of config dir seems non-optimal

This is obviously highly subjective, but I was surprised at how the cli handles the configuration directory. Two things struck me as being "not what I would prefer":

  • The fact that it looks for .boot2docker on non-Windows and boot2docker (no dot) on Windows. Since we're assuming msys here it would seem better to use .boot2docker everywhere. That's consistent with how other tools in that environment work (and behaves nicely with ls).
  • The fact that it doesn't create the configuration directory if it doesn't already exist. When I first start using boot2docker-cli on my machine I'm not likely to have its configuration directory already. So that means it will back off to the CWD. The net result is that I'm likely to end up with boot2docker.iso files scattered in random places, which doesn't seem good. Personally I'd expect it to just create the missing directory (assuming this was a first use) and then put stuff there by default.

name of binary

We need to streamline this as the last change from @SvenDowideit in the Dockerfile will create a binary which is called boot2docker-cli

Failed to stop machine "boot2docker-vm": exit status 1

Running VirtualBox 4.3.10 (upgraded from 4.3.7 to make sure that wasn't the issue).

Seems like this issue may be in the VirtualBox wrapper:

|ruby-1.9.3-p448| Isaacs-MacBook-Air-2 in ~/git/yacn/boot2docker-cli
ยฑ |fix/broken-cmdSSH โœ—| โ†’ b2d stop -v
2014/04/01 15:17:07 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/04/01 15:17:07 executing: VBoxManage controlvm boot2docker-vm acpipowerbutton
2014/04/01 15:17:08 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/04/01 15:17:08 executing: VBoxManage controlvm boot2docker-vm acpipowerbutton
2014/04/01 15:17:10 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/04/01 15:17:10 executing: VBoxManage controlvm boot2docker-vm acpipowerbutton
2014/04/01 15:17:11 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/04/01 15:17:11 executing: VBoxManage controlvm boot2docker-vm acpipowerbutton
2014/04/01 15:17:12 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/04/01 15:17:12 executing: VBoxManage controlvm boot2docker-vm acpipowerbutton
VBoxManage: error: Invalid machine state: PoweredOff
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component Console, interface IConsole, callee nsISupports
VBoxManage: error: Context: "PowerButton()" at line 276 of file VBoxManageControlVM.cpp
2014/04/01 15:17:12 Failed to stop machine "boot2docker-vm": exit status 1

The most interesting part in there IMO is VBoxManage: error: Invalid machine state: PoweredOff.

"init" command fails attaching disk image

Platform -- Windows 7 64 bit

When I do a boot2docker-cli init I get the following failure:

2014/04/30 18:22:07 Setting VM storage...
2014/04/30 18:22:45 Failed to attach disk image "c:\Users\sfitts\VirtualBox VMs\boot2docker-vm
boot2docker-vm.vmdk": exit status 1

The VBox log file contains:

00:00:00.438025 ERROR [COM]: aRC=E_FAIL (0x80004005) aIID={480cf695-2d8d-4256-9c7c-cce4184f
a048} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false
00:00:00.560032 ERROR [COM]: aRC=E_FAIL (0x80004005) aIID={480cf695-2d8d-4256-9c7c-cce4184f
a048} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false
00:00:19.905138 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={480cf695-2d8d-4
256-9c7c-cce4184fa048} aComponent={SessionMachine} aText={No storage device attached to device slot
0 on port 0 of controller 'SATA'}, preserve=false
00:00:19.906138 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={480cf695-2d8d-4
256-9c7c-cce4184fa048} aComponent={SessionMachine} aText={No storage device attached to device slot
0 on port 0 of controller 'SATA'}, preserve=false
00:00:29.913711 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={fafa4e17-1ee2-4905-a10e-
fe7c18bf5554} aComponent={VirtualBox} aText={The object is not ready}, preserve=false

boot2docker-cli init fails on Mac OS X

I just tried "boot2docker-cli init" on Mac OS X 10.9.2, and it had an error at the same point the Windows machine:
$ boot2docker-cli init
Converting from raw image file="stdin" to file="/Users/gmlewis/.boot2docker/boot2docker.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
2014/03/07 19:48:32 Creating VM boot2docker-vm...
Virtual machine 'boot2docker-vm' is created and registered.
UUID: 90fa04d0-77ef-48f6-80a0-c7beae067e9a
Settings file: '/Users/gmlewis/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox'
2014/03/07 19:48:32 Setting VM networking...
2014/03/07 19:48:32 Port forwarding [ssh]: host tcp://127.0.0.1:2022 --> guest tcp://0.0.0.0:22
2014/03/07 19:48:32 Port forwarding [docker]: host tcp://127.0.0.1:4243 --> guest tcp://0.0.0.0:4243
2014/03/07 19:48:32 Setting VM host-only networking
Creating a new hostonly network interface
2014/03/07 19:48:33 Failed to create boot2docker-vm: exit status 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.