github.com/solo-io/unik@v0.0.0-20190717152701-a58d3e8e33b7/docs/examples/example-osv-mysql/README.md (about) 1 # Example C/C++ application for OSv (MySQL) 2 3 This example demonstrates use of pre-compiled applications\* that are available to OSv compiler. 4 To use these applications (e.g. MySQL) only configuration files are needed since the actual 5 application is automatically downloaded from public repository. 6 7 \* * You can, naturally, also compile your own C/C++ application and use it instead of 8 pre-compiled ones. Make sure that you compile it with Ubuntu14 compile tools. 9 into PIC (position independent code) shared object. * 10 11 ## Configuration files 12 13 ### manifest.yaml 14 ``` 15 image_size: 20GB 16 ``` 17 This file tells UniK what logical filesystem size would we like to use for the unikernel. 18 19 ### meta/package.yaml 20 ``` 21 name: my.test 22 title: My Test 23 author: I am 24 require: 25 - eu.mikelangelo-project.app.mysql-5.6.21 26 ``` 27 This file tells UniK what pre-comiled packages to download and include into the unikernel. 28 It also provides some additional information about our unikenrel that is not very relevant 29 for the build process, but is required by underlying Capstan compiler. 30 31 ### meta/run.yaml 32 ``` 33 config_set: 34 conf1: 35 bootcmd: /usr/bin/mysqld --datadir=/usr/data --user=root --init-file=/etc/mysql-init.txt 36 37 config_set_default: conf1 38 ``` 39 This file specifies boot command to boot unikernel with. A single configuration set 40 `conf1` (that is also set as default) is specified. It tells UniK what executable to run 41 (/usr/bin/mysqld) and what arguments to use (--datadir=/usr/data --user=root --init-file=/etc/mysql-init.txt) 42 43 ## Build command 44 ``` 45 $ unik build \ 46 --name osv-mysql-example \ 47 --path ./ \ 48 --base osv \ 49 --language native \ 50 --provider [qemu|openstack] 51 ``` 52 NOTE: Unikernel with MySQL application needs at least 1GB of memory to boot properly.