In order to consume the images and applications from online repositories, the user needs to set up the online repository URL and ECDSA public key in their ``/etc/spoc/spoc.conf`` file. The configuration file directives are covered on the `architecture <spoc-architecture.html>`_ page.
The user can choose to download any image and spawn a separate standalone container, not tied to any application. To list the images in the respective repositories, ``spoc-image list`` command is used.
..code-block:: text
usage: spoc-image list [{installed,online,published}]
positional arguments:
{installed,online,published}
Selected repository
Download image
^^^^^^^^^^^^^^
Then the user needs to issue ``spoc-image download`` to download the image and make it available locally.
..code-block:: text
usage: spoc-image download image
positional arguments:
image Name of the image to download
Delete image
^^^^^^^^^^^^
If the user wishes to delete locally installed image, they need to run ``spoc-image delete``.
..code-block:: text
usage: spoc-image delete image
positional arguments:
image Name of the image to delete
Cleanup unused images
^^^^^^^^^^^^^^^^^^^^^
If the user wants to clean up all locally installed images which are not used by any container, there is ``spoc-image clean`` to do just that.
..code-block:: text
usage: spoc-image clean
Containers
----------
Create container
^^^^^^^^^^^^^^^^
To create a container based on locally installed image, the user needs to use ``spoc-container create`` command. This command has a lot of parameters, making it possible to customize every aspect of the container supported by SPOC.
Add another container as a start dependency - prepend the name with ! to remove the dependency
-m MOUNT, --mount MOUNT
Add mount to the container - format volume:mountpoint - specify empty mountpoint to remove the mount
-e ENV, --env ENV Add environment variable for the container - format KEY=value - specify empty value to remove the env
-u UID, --uid UID Sets the container init UID
-g GID, --gid GID Sets the container init GID
-c CMD, --cmd CMD Sets the container init command
-w WORKDIR, --workdir WORKDIR
Sets the container init working directory
-r READY, --ready READY
Sets the container ready command
-s STOPSIG, --stopsig STOPSIG
Sets the signal to be sent to init on container shutdown
Destroy container
^^^^^^^^^^^^^^^^^
To destroy the container, i.e. to unregister from metadata and remove its LXC configuration, ``spoc-container destroy`` should be used.
..code-block:: text
usage: spoc-container destroy container
positional arguments:
container Name of the container to destroy
The containers can be started and stopped via commands ``spoc-container start`` and ``spoc-container stop``. The start command allows to override the default init command.
Start / stop container
^^^^^^^^^^^^^^^^^^^^^^
..code-block:: text
usage: spoc-container start container ...
positional arguments:
container Name of the container to start
command Command to be run instead of the default init command
..code-block:: text
usage: spoc-container stop container
positional arguments:
container Name of the container to stop
Check container status
^^^^^^^^^^^^^^^^^^^^^^
In order to check status of a container ``spoc-container status`` command can be issued.
..code-block:: text
usage: spoc-container status [-h] container
positional arguments:
container Name of the container to check
Execute command in a container
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Finally, whenever a command needs to be run in context of the container, ``spoc-container exec`` can be used. This command automatically determines if the container is stopped or started and depending on that, it either created the namespace or just attach to the already existing one.
container Name of the container in which to run the command
command The command to be run
optional arguments:
-u UID, --uid UID Sets the command UID
-g GID, --gid GID Sets the command GID
Applications
------------
List applications
^^^^^^^^^^^^^^^^^
In similar fashion like the images, the user can list also the applications and filter them by repository or status. This is done via ``spoc-app list`` command.
..code-block:: text
usage: spoc-app list [{installed,online,updates,published,running,stopped}]
To install an application, the user issues ``spoc-app install`` command. SPOC's dependency solver and task queue ensures that the components used by the application are made available first before the application is attempted to be installed.
..code-block:: text
usage: spoc-app install app
positional arguments:
app Name of the application to install
Update application
^^^^^^^^^^^^^^^^^^
In the same way as installation, the user can update locally installed application via ``spoc-app update``.
..code-block:: text
usage: spoc-app update app
positional arguments:
app Name of the application to update
Uninstall application
^^^^^^^^^^^^^^^^^^^^^
To uninstall the application, the user runs ``spoc-app uninstall``. Note that this command only uninstalls the application and removes its containers, leaving all the images formerly used by them locally registered and installed. In order to remove them for good, user may execute ``spoc-image clean`` described above.
..code-block:: text
usage: spoc-app uninstall app
positional arguments:
app Name of the application to uninstall
Start / stop application
^^^^^^^^^^^^^^^^^^^^^^^^
In order to start or stop the application, resp. all its containers in the order given by the dependencies in metadata, the user can issue ``spoc-app start`` and ``spoc-app stop`` respectively.
..code-block:: text
usage: spoc-app start app
positional arguments:
app Name of the application to start
..code-block:: text
usage: spoc-app stop app
positional arguments:
app Name of the application to stop
Check application status
^^^^^^^^^^^^^^^^^^^^^^^^
To check the application status, the user can use ``spoc-app status``. The application is just a group of containers, so the output will simply display status of all containers in the given application environment.
..code-block:: text
usage: spoc-app status app
positional arguments:
app Name of the application to check
Set application autostart
^^^^^^^^^^^^^^^^^^^^^^^^^
To have the application automatically started after the VM boots up (resp. when the host's init executes the SPOC service), one can use ``spoc-app autostart``. This option exists only for applications, not for the individual containers.