June 13, 2016
Vessels behave just like any other virtual machine, which means you can actually run operations inside them. This becomes very useful when you want ot configure the vessel to possess attributed not available in the recipe it depends on. Examples of this could be installing new dependencies or altering configuration files.
The Spacedecode runtime allows you to issue commands to a running vessel through its exec.
spaced vessel execdoesn’t actually run the command passed. It prepares the request and hands it over to the daemon, which makes contact with the vessel in question and execute the command inside.
To execute a command in a vessel, first make sure that it is running. The command you will use for this is in the form:
$ spaced vessel exec <vessel_id> <command>
Note: Use the vessel listing command to get the ID of the vessel in which you want to run the command.
A practical example would look something like this:
$ spaced vessel exec e1e4e573b0ea4cea8e3203f74b1b8b90 bash root@server:/#
execfunction compiles the request payload into a
JSONobject, so be sure to properly escape commands containing special characters.