Containers are the centre piece of the Anbox Cloud stack. Every time you launch an application or an image, Anbox Cloud creates a container for it. Every container provides a full Android system.
Regular containers vs. base containers
Anbox Cloud differentiates between two types of containers: regular containers and base containers. The container type is visible in the output of the
amc ls command.
Regular containers are containers that are launched from either an application or an image. They exist until they are deleted.
Base containers are temporary containers that are used when bootstrapping an application. They are automatically deleted when the application bootstrap is completed.
When we refer to containers in this documentation without specifying the container type, we mean regular containers.
Application containers vs. raw containers
Application containers, thus containers created when launching an application, run the full Android system. If the application is based on an Android app (an APK package), this app is launched after the system boots and monitored by the watchdog. With the default configuration, you will see only the app and not the Android launcher.
Containers that are created when launching an image are called raw containers. They run the full Android system, without any additional apps installed.
Data stored in containers
All containers in Anbox Cloud are ephemeral, which means that as soon as a container is stopped, all of its data is gone. Anbox Cloud DOES NOT back up any data from the Android or the outer Ubuntu container. Backup and restore of data must be implemented separately through addons. See Example: Back up data for information on how to do this.
Container life cycle
When you create a container by launching an application or an image, it executes the following steps in order:
- Configure the network interface and gateway.
- Only raw containers: Install addons that are specified with
- Expose services that are specified with
--serviceor through the application manifest.
- Execute the
pre-starthook provided by the installed addons.
- Launch the Android container.
- Execute the
post-starthook provided by the installed addons.
The whole launch process is successful only if all of the above steps succeed.
If anything goes wrong during the container launch process, the status of the container changes to the
error status. You can view the available logs from the container for diagnosing the root cause of the problem.
When a container is stopped, either because you deleted it or because an error occurred, it executes the following steps in order:
- Stop the Android container.
- Execute the
post-stophook provided by the installed addons.
- Shut down the container.
Possible container status
Throughout its lifetime, a container moves through different stages depending on the state it’s currently in.
||AMS has created an internal database object for the container and will schedule the container onto a suitable LXD node next.|
||AMS has decided on which LXD node the container will be placed.|
||The container was started and is now booting. During the boot sequence, possible hooks are executed. Only when all hooks have been executed, the container will switch to
||The container is fully up and running.|
||The container is fully stopped and will be deleted by AMS.|
||The container is deleted and will be removed from the AMS database soon.|
||An error occurred while processing the container. The container is stopped. Further information about the error can be viewed with