SlideShare a Scribd company logo
github.com/coreos/rkt
rkt-dev@googlegroups.com
App Container
github.com/appc
appc-dev@googlegroups.com
Yifan Gu
github.com/yifan-gu
@yifan7702
With containers what
does a "Linux Distro"
mean?
KERNEL
SYSTEMD
SSH
PYTHON
JAVA
NGINX
MYSQL
OPENSSL
distrodistrodistro
distro
APP
KERNEL
SYSTEMD
SSH
LXC/DOCKER/
RKT
PYTHON
JAVA
NGINX
MYSQL
OPENSSL
APP
distrodistrodistro
distro
The Bad
$ python --version
Python 2.7.6
$ python app-requiring-python3.py
$ python --version
Python 3.4.3
$ python app-requiring-python2.py
package collisions
The Bad
$ cat /etc/os-release | grep ^NAME=
NAME=Fedora
$ rpm -i package-from-suse.rpm
file /foo from install of
package-from-suse.rpm conflicts with
file from package-from-fedora
dependency namespacing
The Good
$ gpg --list-only --import 
/etc/apt/trusted.gpg.d/*
gpg: key 2B90D010: public key "Debian Archive
Automatic Signing Key (8/jessie)
<ftpmaster@debian.org>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
gpg: no ultimately trusted keys found
users control trust
The Good
$ rsync ftp.us.debian.org::debian 
/srv/mirrors/debian
$ dpkg -i  /srv/mirrors/debian/kernel-image-
3.16.0-4-amd64-di_3.16.7-ckt9-2_amd64.udeb
trivial mirroring and hosting
Linux Packages 2.0
.deb and .rpm for containers
Container VS VM?
● Lightweight (100s vs 10s)
● Easy to deploy
● Less isolation?
What is container ?
● Packaging with your apps with deps
● Running in isolation (using namespace,
cgroups)
Why I want to use it?
● Deploy faster
● Run faster, run everywhere
● Run in isolation
App Container (appc)
github.com/appc
appc-dev@googlegroups.com
appc != rkt
Application Containers
self-contained, portable
(decoupled from operating system)
isolated (memory, network, …)
appc principles
Why are we doing this?
Open
Independent GitHub organisation
Contributions from Cloud Foundry,
Mesosphere, Google, Red Hat
(and many others!)
Simple but efficient
Simple to understand and implement, but
eye to optimisation (e.g. content-based
caching)
Secure
Cryptographic image addressing
Image signing and encryption
Container identity
Standards-based
Well-known tools (tar, gzip, gpg, http),
extensible with modern technologies
(bittorrent, xz)
Composable
Integrate with existing systems
Non-prescriptive about build workflows
OS/architecture agnostic
appc components
Image Format
Application Container Image
tarball of rootfs + manifest
uniquely identified by ImageID (hash)
Image Discovery
App name → artifact
example.com/http-server
coreos.com/etcd
HTTPS + HTML
Executor (Runtime)
grouped applications
runtime environment
isolators
networking
Metadata Service
http://$AC_METADATA_URL/acMetadata
container metadata
container identity (HMAC verification)
ACE validator
is this executor compliant with the spec?
$EXECUTOR run ace_validator.aci
appc community
github.com/
cdaylward/libappc
C++ library for working with app containers
github.com/
cdaylward/nosecone
C++ executor for running app containers
mesos (wip)
https://issues.apache.org/jira/browse/MESOS-2162
github.com/
3ofcoins/jetpack
FreeBSD Jails/ZFS-based executor
(by @mpasternacki)
github.com/
sgotti/acido
ACI toolkit (build ACIs from ACIs)
github.com/
appc/docker2aci
docker2aci busybox/latest
docker2aci quay.io/coreos/etcd
github.com/
appc/goaci
goaci github.com/coreos/etcd
appc spec in a nutshell
- Image Format (ACI)
- what does an application consist of?
- Image Discovery
- how can an image be located?
- Pods
- how can applications be grouped and run?
- Executor (runtime)
- what does the execution environment look like?
appc status
Stabilising
towards first backwards
compatible release
github.com/coreos/rkt
rkt
an implementation of appc
Open standards.
Composability.
rkt
rkt
a modern, secure container runtime
rkt
simple CLI tool
simple CLI tool
golang + Linux
self-contained
init system/distro agnostic
simple CLI tool
no daemon
no API*
apps run directly under spawning process
bash
rkt
application(s)
runit
rkt
application(s)
systemd
rkt
application(s)
rkt internals
modular architecture
execution divided into stages
stage0 → stage1 → stage2
rkt (stage0)
pod (stage1)
bash/runit/systemd/... (invoking process)
app1 (stage2)
app2 (stage2)
rkt (stage0)
pod (stage1)
bash/runit/systemd/... (invoking process)
app1 (stage2)
app2 (stage2)
stage0 (rkt binary)
discover, fetch, manage application images
set up pod filesystems
commands to manage pod lifecycle
stage0 (rkt binary)
- rkt run
- rkt prepare
- rkt run-prepared
- rkt list
- rkt status
- ...
- rkt fetch
- rkt trust
- rkt image list
- rkt image export
- rkt image gc
- ...
stage0 (rkt binary)
file-based locking for concurrent operation
(e.g. rkt gc, rkt list for pods)
database + reference counting for images
rkt (stage0)
pod (stage1)
bash/runit/systemd/... (invoking process)
app1 (stage2)
app2 (stage2)
rkt (stage0)
pod (stage1)
bash/runit/systemd/... (invoking process)
app1 (stage2)
app2 (stage2)
stage1
execution environment for pods
app process lifecycle management
isolators
stage1 (swappable)
binary ABI with stage0
stage0 calls an execve(stage1)
stage1 (swappable)
● default implementation
○ based on systemd-nspawn+systemd
○ Linux namespaces + cgroups for isolation
● kvm implementation
○ based on lkvm+systemd
○ hardware virtualisation for isolation
● others?
rkt (stage0)
pod (stage1)
bash/runit/systemd/... (invoking process)
app1 (stage2)
app2 (stage2)
rkt (stage0)
pod (stage1)
bash/runit/systemd/... (invoking process)
app1 (stage2)
app2 (stage2)
stage2
actual app execution
independent filesystems (chroot)
shared namespaces, volumes, IPC, ...
rkt + systemd
The different ways rkt integrates with
systemd
rkt
rkt
systemd (on host)
(systemctl)
systemd (on host)
optional
"systemctl stop" just works
socket activation
pod-level isolators: CPUShares, MemoryLimit
rkt
systemd-nspawn
systemd (on host)
(systemctl)
systemd-nspawn
default stage1, besides lkvm
taking care of most of the low-level things
rkt
systemd-nspawn
systemd
systemd (on host)
(systemctl)
container
systemd
pid1
service files
socket activation
rkt
systemd-nspawn
application
systemd
systemd (on host)
(systemctl)
container
application
app-level isolators: CPUShares, MemoryLimit
chrooted
rkt
systemd-nspawn
application
systemd-journald
(journalctl)
logs
systemd
systemd (on host)
(systemctl)
container
systemd-journald
no changes in apps required
logs in the container
available from the host with journalctl -m / -M
rkt
systemd-nspawn
application
systemd-machined
(machinectl)
systemd-journald
(journalctl)
logs
systemd
register
systemd (on host)
(systemctl)
container
systemd-machined
register on distros using systemd
machinectl {show,status,poweroff…}
rkt
systemd-nspawn
application
systemd-machined
(machinectl)
systemd-journald
(journalctl)
logs
systemd
register
systemd (on host)
(systemctl)
container
cgroups
What’s a control group? (cgroup)
● group processes together
● organised in trees
● applying limits to them as a group
cgroups
cgroup API
/sys/fs/cgroup/*/
/proc/cgroups
/proc/$PID/cgroup
List of cgroup controllers
/sys/fs/cgroup/
├─ cpu
├─ devices
├─ freezer
├─ memory
├─ ...
└─ systemd
/sys/fs/cgroup/
├─ systemd
│ ├─ user.slice
│ ├─ system.slice
│ │ ├─ NetworkManager.service
│ │ │ └─ cgroups.procs
│ │ ...
│ └─ machine.slice
How systemd units use cgroups
│...
├─ cpu
│ ├─ user.slice
│ ├─ system.slice
│ └─ machine.slice
│ └─ machine-rkt….scope
│ └─ system.slice
│ └─ app.service
├─ memory
│ ├─ user.slice
│ ├─ system.slice
│ └─ machine.slice ...
/sys/fs/cgroup/
├─ systemd
│ ├─ user.slice
│ ├─ system.slice
│ └─ machine.slice
│ └─ machine-rkt….scope
│ └─ system.slice
│ └─ app.service
│
│
│...
How systemd units use cgroups w/
containers
/sys/fs/cgroup/
├─ systemd
│ ├─ user.slice
│ ├─ system.slice
│ └─ machine.slice
│ └─ machine-rkt….scope
│ └─ system.slice
│ └─ app.service
│
│
│...
│...
├─ cpu
│ ├─ user.slice
│ ├─ system.slice
│ └─ machine.slice
│ └─ machine-rkt….scope
│ └─ system.slice
│ └─ app.service
├─ memory
│ ├─ user.slice
│ ├─ system.slice
│ └─ machine.slice ...
cgroups mounted in the container
RW
RO
Example: memory isolator
“limit”:
“500M”
Application
Image Manifest
[Service]
ExecStart=
MemoryLimit=500M
systemd service file
write to
memory.limit_in_
bytes
systemd action
Example: CPU isolator
“limit”:
“500m”
Application
Image Manifest
write to
cpu.share
systemd action
[Service]
ExecStart=
CPUShares=512
systemd service file
Unified cgroup hierarchy
● Multiple hierarchies:
○ one cgroup mount point for each controller (memory, cpu, etc.)
○ flexible but complex
○ cannot remount with a different set of controllers
○ difficult to give to containers in a safe way
● Unified hierarchy:
○ cgroup filesystem mounted only one time
○ still in development in Linux: mount with option
“__DEVEL__sane_behavior”
○ initial implementation in systemd-v226 (September 2015)
○ no support in rkt yet
rkt: a few other things
- rkt and security
- rkt API service (new!)
- rkt networking
- rkt and user namespaces
- rkt and production
rkt and security
"secure by default"
rkt security
- image signature verification
- privilege separation
- e.g. fetch images as non-root user
- SELinux integration
- kernel keyring integration (soon)
- lkvm stage1 for true hardware isolation
rkt API service (new!)
optional, gRPC-based API daemon
exposes information on pods and images
runs as unprivileged user
easier integration with other projects
rkt networking
plugin-based
Container Networking Interface (CNI)
Container Runtime (e.g. rkt)
veth macvlan ipvlan OVS
Container Networking Interface (CNI)
Networking, the rkt way
Network tooling
● Linux can
create pairs of
virtual net
interfaces
● Can be linked
in a bridge
container1 container2
eth0
veth1
eth0
veth2
IP masquerading via iptables
eth0
bridge
rkt and user namespaces
History of Linux namespaces
✓ 1991: Linux
✓ 2002: namespaces in Linux 2.4.19
✓ 2008: LXC
✓ 2011: systemd-nspawn
✓ 2013: user namespaces in Linux 3.8
✓ 2013: Docker
✓ 2014: rkt
… development still active
Why user namespaces?
● Better isolation
● Run applications which would need more
capabilities
● Per user limits
● Future?
○ Unprivileged containers: possibility to have container without root
0
host
65535
4,294,967,295
(32-bit range)
0
container 1
655350
container 2
User ID ranges
unmapped
User ID mapping
/proc/$PID/uid_map: “0 1048576 65536”
host
container
1048576
65536
65536
unmappedunmapped
Problems with container images
Container
filesystem
Container
filesystem
Overlayfs “upper”
directory
Overlayfs “upper”
directory
Application Container Image (ACI)
Application
Container
Image (ACI)
container 1 container 2
downloading
web server
Problems with container images
● Files UID / GID
● rkt currently only supports user namespaces
without overlayfs
○ Performance loss: no COW from overlayfs
○ “chown -R” for every file in each container
Problems with volumes
/
/home/var
user
/
/data /my-app
bind mount
(rw / ro)
/data
● mounted in
several
containers
● No UID
translation
/data
User namespace and filesystem
problem
● Possible solution: add options to mount() to
apply a UID mapping
● rkt would use it when mounting:
○ the overlay rootfs
○ volumes
● Idea suggested on kernel mailing lists
rkt and production
- still pre-1.0
- unstable (but stabilising) CLI and API
- explicitly not recommended for production
- although some early adopters
rkt v1.0.0
EOY (fingers crossed)
stable API
stable CLI
ready to use!
Questions?
github.com/coreos/rkt
coreos.com/careers (soon in Berlin!)
Join us!

More Related Content

PDF
Introduction to Project atomic (CentOS Dojo Bangalore)
PDF
SCALE 2011 Deploying OpenStack with Chef
PDF
Introduction and Deep Dive Into Containerd
PDF
[DockerCon 2019] Hardening Docker daemon with Rootless mode
PDF
Perspectives on Docker
PDF
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
PDF
[FOSDEM 2020] Lazy distribution of container images
PDF
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
Introduction to Project atomic (CentOS Dojo Bangalore)
SCALE 2011 Deploying OpenStack with Chef
Introduction and Deep Dive Into Containerd
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Perspectives on Docker
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[FOSDEM 2020] Lazy distribution of container images
[DockerCon 2020] Hardening Docker daemon with Rootless Mode

What's hot (20)

PDF
Docker 原理與實作
PDF
Rkt Container Engine
PDF
[KubeCon NA 2020] containerd: Rootless Containers 2020
PDF
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
PDF
[KubeCon EU 2020] containerd Deep Dive
PDF
Tech Talk - Vagrant
PDF
Techtalks: taking docker to production
PDF
Rootless Containers & Unresolved issues
PDF
Docker 101 - from 0 to Docker in 30 minutes
PDF
Docker 初探,實驗室中的運貨鯨
PPTX
Usernetes: Kubernetes as a non-root user
PDF
Ansible docker
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
PDF
Introduction to CRI and OCI
PDF
LXC, Docker, and the future of software delivery | LinuxCon 2013
PDF
DCSF 19 Deploying Rootless buildkit on Kubernetes
PDF
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
PDF
The State of Rootless Containers
ODP
Docker engine - Indroduc
PDF
Startup Containers in Lightning Speed with Lazy Image Distribution
Docker 原理與實作
Rkt Container Engine
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeCon EU 2020] containerd Deep Dive
Tech Talk - Vagrant
Techtalks: taking docker to production
Rootless Containers & Unresolved issues
Docker 101 - from 0 to Docker in 30 minutes
Docker 初探,實驗室中的運貨鯨
Usernetes: Kubernetes as a non-root user
Ansible docker
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to CRI and OCI
LXC, Docker, and the future of software delivery | LinuxCon 2013
DCSF 19 Deploying Rootless buildkit on Kubernetes
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
The State of Rootless Containers
Docker engine - Indroduc
Startup Containers in Lightning Speed with Lazy Image Distribution
Ad

Viewers also liked (8)

PDF
KubeCon EU 2016: "rktnetes": what's new with container runtimes and Kubernetes
PDF
Getting Started with Containers
PDF
containerd and what it means for the container ecosystem
PPTX
Docker for the new Era: Introducing Docker,its components and tools
PPTX
Python at Facebook
PDF
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
PDF
Basic docker for developer
PPTX
Lxc – next gen virtualization for cloud intro (cloudexpo)
KubeCon EU 2016: "rktnetes": what's new with container runtimes and Kubernetes
Getting Started with Containers
containerd and what it means for the container ecosystem
Docker for the new Era: Introducing Docker,its components and tools
Python at Facebook
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Basic docker for developer
Lxc – next gen virtualization for cloud intro (cloudexpo)
Ad

Similar to App container rkt (20)

PPTX
Introduction to Docker
PPTX
Container & kubernetes
PPTX
Dockerizing a Symfony2 application
PDF
LibOS as a regression test framework for Linux networking #netdev1.1
PPTX
Why you’re going to fail running java on docker!
PDF
Develop QNAP NAS App by Docker
PPTX
Introduction to docker
PDF
GDG Cloud Iasi - Docker For The Busy Developer.pdf
PDF
Delivering Docker & K3s worloads to IoT Edge devices
PDF
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
PDF
Automate drupal deployments with linux containers, docker and vagrant
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PDF
Security of Linux containers in the cloud
PDF
Genode Compositions
PDF
CoreOS @ gluecon 2015
PDF
Kubernetes laravel and kubernetes
PDF
Docker and friends at Linux Days 2014 in Prague
PDF
Real-World Docker: 10 Things We've Learned
PDF
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
PDF
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Introduction to Docker
Container & kubernetes
Dockerizing a Symfony2 application
LibOS as a regression test framework for Linux networking #netdev1.1
Why you’re going to fail running java on docker!
Develop QNAP NAS App by Docker
Introduction to docker
GDG Cloud Iasi - Docker For The Busy Developer.pdf
Delivering Docker & K3s worloads to IoT Edge devices
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Automate drupal deployments with linux containers, docker and vagrant
Dependencies Managers in C/C++. Using stdcpp 2014
Security of Linux containers in the cloud
Genode Compositions
CoreOS @ gluecon 2015
Kubernetes laravel and kubernetes
Docker and friends at Linux Days 2014 in Prague
Real-World Docker: 10 Things We've Learned
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Lecture Notes Electrical Wiring System Components
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Well-logging-methods_new................
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
PPT on Performance Review to get promotions
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Welding lecture in detail for understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPT
Project quality management in manufacturing
PDF
Digital Logic Computer Design lecture notes
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Structs to JSON How Go Powers REST APIs.pdf
Lecture Notes Electrical Wiring System Components
Mechanical Engineering MATERIALS Selection
Lesson 3_Tessellation.pptx finite Mathematics
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Well-logging-methods_new................
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPT on Performance Review to get promotions
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT 4 Total Quality Management .pptx
Welding lecture in detail for understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Project quality management in manufacturing
Digital Logic Computer Design lecture notes
CYBER-CRIMES AND SECURITY A guide to understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems

App container rkt