Better_Software_Header_Mobile Better_Software_Header_Web

Find what you need - explore our website and developer resources

Containers - Cloud Tech Comes to Embedded

What is chroot?

The power behind containers: namespaces

ContainersVirtual machines (VMs)
Architecture• Containers are application-centric• VMs are hardware-centric
• OS-level virtualization is achieved through user-space abstractions and namespace isolation• The guest machine is emulated with a complete stack of virtualized hardware
• Hypervisors are unnecessary; container services use OS features• Hardware assistance and/or hyper-visors are required
Operating system (OS)• The OS and kernel are shared between all applications and the host OS• It’s possible to host a unique OS (Windows IoT, Linux, QNX, etc) in each VM
File system• Each container has its own files, which can be transparently mixed with files from shared volumes and host folders•VM filesystems reside completely within VM images
• Containers have more flexibility on how their files are managed•VMs can only access their host’s files through virtual networks and server apps
•VM filesystems do not have to be the same as host filesystems
Memory• Memory consumption for containers is nearly the same as for standard applications• VMs contain entire OS memory layouts so their memory consumption is much more than single applications
• App memory allocations come directly from operating systems• App memory allocations come from the VM OS, which requests pages from the host OS (or are reserved by the host OS)
• Containers can use any available memory or be constrained• VM memory use is generally fixed and instantiated for each VM
• Containers share read-only portions, so running multiple containers only pays a one-time hit on largest RAM use
Start-up time• Since the OS is already booted, only con- tainer initialization is required, generally taking much less time• A full OS boot is required; optimiz ing this takes additional work but regardless is generally longer
Image size• Containers are generally smaller than VMs• VMs are generally larger than containers
Layering / Versioning•Containers can be built from multiple layers (called multistage builds), allowing for clean isolation of developer and production environments, environment portability, and other build configurations• Layering must be done manually if needed
• Designed for easy versioning of container images with built-in version management• VM images are huge binary files not appropriate for version control
• Docker images are stateless and do not contain modified files• Without developer intervention, VM images aren’t automatically stateless making them much harder to archive, duplicate, and test reliably
Security• The barrier between containers and the OS is thinner• Virtualized hardware isolates VMs from each other
• Containers make syscalls into the kernel, providing a larger attack surface• VM calls the host OS services exclusively through the host hypervisor, so attack surfaces are much smaller

Tags:

embedded
Till Adam and Sven Knebel