How to launch a container

You can launch a container for a registered application or image (see Application containers vs. raw containers), either by using the amc tool or through another service over the REST API that the AMS service provides.

By default, the container will run headless. See How to access a container for instructions on how to access it for debugging purposes, and About application streaming for information about the streaming stack.

Launch application containers

Launching a container for a registered application can be achieved with the
following command:

amc launch <application id>

As argument, provide the ID of the application that you want to launch. You can
list all available applications with the amc application ls command:

|          ID          |      NAME      | INSTANCE TYPE | ADDONS | PUBLISHED | STATUS |    LAST UPDATED     |
| bdp7kmahmss3p9i8huu0 |      candy     | a2.3          | ssh    | false     | ready  | 2018-08-14 08:44:41 |

If the application for which you want to launch a container is not yet published (see Update an application for more details), the launch command will fail as it only allows launching a container for a published application. However, you can work around this by specifying a specific version of an application:

amc launch --application-version=0 bcmap7u5nof07arqa2ag

Launch raw containers

The command for launching a raw container from an image is:

amc launch --raw <image id>

As argument, provide the ID or name of the image for which you want to launch a container. See Provided images for a list of images that are available in Anbox Cloud.

You can also list all available images with the amc image ls command:

|          ID          |  NAME   | STATUS | VERSIONS |       USED BY        |
| bh01n90j1qm6416q0ul0 | default | active | 1        |                      |

Launch a container on a specific node

By default, every container is scheduled by AMS onto a LXD node. Alternatively, you can launch a container directly on a specific node:

amc launch --node=lxd0 bcmap7u5nof07arqa2ag

Note: AMS will still verify that the selected node has enough resources to host the container. If not, the container will fail to launch.

Launch a container with a different Anbox platform

By default, containers start with the webrtc platform if --enable-graphics is specified and with the null platform otherwise (see Anbox platforms). To select a different platform, specify it with the -p flag. The selected platform cannot be changed at runtime and must be selected when the container is created. For example, you can launch a container with the webrtc platform like this:

amc launch -p webrtc <application-id>

If you have built your own platform named foo and you built it via an addon into the container images, you can launch a container with the platform the same way:

amc launch -p foo <application-id>