Skip to content

Instantly share code, notes, and snippets.

### The Yaml file support
#### Introduction
如下样例,是一个典型的Yaml格式的文件,存在于examples/ubuntu.yml
```
name: process-yaml-file-ubuntu
containers:
- name: ubuntu
image: ubuntu:latest

The Yaml file support

Introduction

如下样例,是一个典型的Yaml格式的文件,存在于examples/ubuntu.yml

name: process-yaml-file-ubuntu
containers:
  - name:          ubuntu
    image:         ubuntu:latest
    workdir:       /
官方的安装文档是使用go get github.com/tools/godep,很可惜,因为“网络”问题会报一个找不到golang.org/x/tools/go/vcs的错误。而https://github.com/golang/tools 是 golang.org/x/tools的一个镜像,代码是一样的,所以我是如下安装的。
* set your GOPATH
* make a dir in your $GOPATH/src/, like $GOPATH/src/golang.org/x
* `git clone https://github.com/golang/tools $GOPATH/src/golang.org/x/tools`
* `go get github.com/tools/godep`
* add $GOPATH/bin dir in PATH env
* update the local hyper private repo
* you can `godep go build hyper.go/hyperd.go`
lei@ubuntu:/root/ws/src/hyper$ git diff
diff --git a/qemu/context.go b/qemu/context.go
index 2a1c096..9e64cfc 100644
--- a/qemu/context.go
+++ b/qemu/context.go
@@ -65,7 +65,7 @@ type VmContext struct {
timer *time.Timer
process *os.Process
lock *sync.Mutex //protect update of context
- wg *sync.WaitGroup
@carmark
carmark / vboxmanage_examples.md
Created June 16, 2015 01:44
VBoxManage simple examples

As something of a follow-up post to the previous entry, here’s a quick recipe for creating a Virtual Machine using the VirtualBox command line tools:

We’re using Windows Server 2008 64bit as an example, modify to taste.

$ VM='Windows-2008-64bit'

Create a 32GB “dynamic” disk.

@carmark
carmark / test_result.md
Last active August 29, 2015 14:25
The test Dockerfile and result

Dockerfile

FROM busybox:latest

MAINTAINER simon@hyper.sh

ENV HOME /root
ENV TEST welcome
lei@ubuntu:~/src/pub/src/hyper$ git diff
diff --git a/client/run.go b/client/run.go
index 4a18923..4016703 100644
--- a/client/run.go
+++ b/client/run.go
@@ -14,6 +14,7 @@ import (
"hyper/engine"
"hyper/lib/promise"
"hyper/pod"
+ "hyper/utils"
@carmark
carmark / how-to.md
Last active August 29, 2015 14:25

1, download the hyper files from https://mega.co.nz/#F!mo0xXTRJ!LMViLJRGy2zm--pRVJ6Z_A

2, copy the hyper/config to /var/lib/hyper/config

3, make dir at /var/lib/docker/vbox/images

mkdir -p /var/lib/docker/vbox/images/

4, copy the hyper/100...00.vdi to /var/lib/docker/vbox/images/

sh-3.2# ./hyperd -v 4 --config=config --nondaemon
[HYPER INFO 0807 10:31:16 50024 hyperd.go] [:97] The config file is config
[HYPER INFO 0807 10:31:16 50024 docker.go] [:48] success to create docker
[HYPER INFO 0807 10:31:16 50024 daemon.go] [:193] The config: kernel=/var/lib/hyper/kernel, initrd=/var/lib/hyper/hyper-initrd.img
[HYPER INFO 0807 10:31:16 50024 daemon.go] [:195] The config: vbox image=/Users/lei/Downloads/hyper-vbox-boot.iso
[HYPER INFO 0807 10:31:16 50024 daemon.go] [:198] The config: bridge=, ip=
[HYPER INFO 0807 10:31:16 50024 daemon.go] [:201] The config: bios=, cbfs=
[HYPER INFO 0807 10:31:16 50024 driver.go] [:137] [graphdriver] using prior storage driver "vbox"
[HYPER INFO 0807 10:31:16 50024 daemon.go] [:632] Using graph driver vbox
[HYPER INFO 0807 10:31:16 50024 daemon.go] [:652] Creating images graph