-
-
Notifications
You must be signed in to change notification settings - Fork 605
Porting native applications to OSv
There are two way to run a native (e.g. C/C++) app on OSv:
- Upload and call it on run time
- Create a "precooked" appliance of OSv and the application
Once launching an appliance, it will automatically start both OSv and the application on top of it.
On both cases, the application have to be in a shared library format (.so). More on how to create a share library from an existing application here
Assuming you have a a shared library x.so you want to run. You will need to:
- Upload the library to OSv file system
- Call it
You can use standard SCP to upload the file over SSH Upload the library, and any additional libraries it depend on to /usr/lib/
scp x.so admin@host:/usr/lib/
Use your real host ip and login/password.
If and only if you are running OSv locally and without a network bridge, you can take advantage of the port forwarding:
scp -P 2222 x.so admin@localhost:/usr/lib/
Connect to OSv CLI, and simply
[/]% run /usr/lib/x
In the near future, OSv will support REST API for both run time uploading and running application.
The easiest way to create an OSv appliance is using Capstan. Go check it out!