-
Notifications
You must be signed in to change notification settings - Fork 0
VBox docker libcontainer setup
-
Get Virtual Box 4.3.12 from Oracle
-
Install and open vBox manager
-
Create a vm (named libcontainer Dev Test)
- 2Gb RAM
- 32Gb HDD
- 4 processors (on separate menu)
- username (
spowell) (when installing op sys) - o/w defaults (ensure network connection -- NAT default)
-
Get Ubuntu (or other distro)
-
ubuntu-14.04-desktop-amd64.iso(got from Glyn)
-
-
Start vm and install from DVD
- accept updates during boot/install
- reboot (no need to remove DVD)
-
Install VBox Guest Additions
- Devices menu in VBox (after booting VM) attaches image
- Accept in dialog
- Reboot (and get largest resolution for display -- can maximise afterwards, so don't worry)
-
Get git and mercurial (needed by go get)
sudo apt-get install git mercurial
-
Get go
-
(Firefox download from golang -- Linux AMD 64bit version -- we are currently on version 1.2.2)
-
After installation rename to
~/golang -
Edit
.profileto include:export GOROOT=$HOME/golang export GOPATH=$HOME/go export PATH=$GOPATH/bin:$PATH:$GOROOT/bin -
Check we have the right version:
- Reboot (
.profilenot rexecuted on restart Terminal? Then modify run terminalas login shellin Terminal preferences.) -
go versionin Terminal/Shell to check -
env|grep GOto check setup
- Reboot (
-
-
Now get the libcontainer code
go get github.com/docker/libcontainer -
Now build/test something
cd ~/go/src/github.com/docker/libcontainer/nsinit go get -t ./... go install nsinitThis outpouts help for nsinit (currently). We should get docker as a byproduct of the get.
Share a folder with the host copy of the Guardian code.
-
Create shared folder on vbox
- point to go project source root (
GOPATH) on host - choose name for it (e.g.
gomac) - is mounted in
/media/sf-gomac -
put local user in
vboxsfgroup or else the folder cannot be accessed (!)sudo adduser spowell vboxsf
- point to go project source root (
-
The go compiler needs to be installed on the vbox, still, and then updates to the code on the host are immediately visible to the vbox machine.
-
add a symboic link to the shared drive go folder
ln -s /media/sf-gomac go -
now try
go installin the nsinit folder as above.
Sharing the git repository with the mac host is slightly dangerous, since the mount (type vboxsf) in Ubuntu
seems to have the permissions look different in the VM. This is probably caused by mounting it with root user.
To change this, execute the following commands in the VM:
sudo umount gomac
sudo mount -t vboxsf -o uid=1000,gid=1000 gomac /media/sf_gomac
Here 1000 is the id for the default user (spowell for me) and their group, gomac is the shared name I chose
when defining the shared folder, and /media/sf_gomac is the name of the mount point (generated by VirtualBox in the obvious way).