github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/docs/compilers/mirage.md (about) 1 # MirageOS Unikernels 2 3 Compile Mirage Ocaml unikernels with unik. 4 5 --- 6 7 Mirage supports only the Xen hypervisor for now (support for Solo5 is planned). So make sure to configure a [Xen provider](../providers/xen.md) for unik (and run the unik daemon on Dom0). 8 9 ## Build an Image 10 11 To compile examples from mirage-skeleton: 12 ``` 13 git clone https://github.com/mirage/mirage-skeleton 14 unik build --name sw --path ./mirage-skeleton/static_website/ --base mirage --language ocaml --provider xen 15 ``` 16 17 ## Volumes 18 19 Unik will automatically detect if the unikernel needs data volumes mounted, and will autogenerate mountpoints. 20 Since there are no directory structure, the mount point will indicate the name of the xen device (rather than a path in the file system) 21 22 You can see the auto generated mountpoints with `unik images` or `unik describe-instance`. 23 24 Example output of `unik images`: 25 ``` 26 NAME ID INFRASTRUCTURE CREATED SIZE(MB) MOUNTPOINTS 27 sw sw XEN 2016-09-20 17:34:40.884854395 35 xen:xvdc 28 ``` 29 30 In our example, the created mountpoint is named "xen:xvdc" 31 32 Now create the volume using unik, and make sure to use the "mirage-fat" type: 33 ``` 34 unik create-volume --name websitedata1 --data ./mirage-skeleton/static_website/htdocs/ --type mirage-fat --provider xen 35 ``` 36 37 ## Run it 38 To run and image with attached volumes, use the run command: 39 ``` 40 unik run --instanceName sw1 --imageName sw --vol websitedata1:xen:xvdc 41 ```