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

What's hot (20)

PDF
Docker 原理與實作
kao kuo-tung
 
PDF
Rkt Container Engine
Thuc Le Dong
 
PDF
[KubeCon NA 2020] containerd: Rootless Containers 2020
Akihiro Suda
 
PDF
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
Akihiro Suda
 
PDF
[KubeCon EU 2020] containerd Deep Dive
Akihiro Suda
 
PDF
Tech Talk - Vagrant
Thomas Krille
 
PDF
Techtalks: taking docker to production
muayyad alsadi
 
PDF
Rootless Containers & Unresolved issues
Akihiro Suda
 
PDF
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
PDF
Docker 初探,實驗室中的運貨鯨
Ruoshi Ling
 
PPTX
Usernetes: Kubernetes as a non-root user
Akihiro Suda
 
PDF
Ansible docker
QNIB Solutions
 
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
PDF
Introduction to CRI and OCI
HungWei Chiu
 
PDF
LXC, Docker, and the future of software delivery | LinuxCon 2013
dotCloud
 
PDF
DCSF 19 Deploying Rootless buildkit on Kubernetes
Docker, Inc.
 
PDF
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
Akihiro Suda
 
PDF
The State of Rootless Containers
Akihiro Suda
 
ODP
Docker engine - Indroduc
Al Gifari
 
PDF
Startup Containers in Lightning Speed with Lazy Image Distribution
Kohei Tokunaga
 
Docker 原理與實作
kao kuo-tung
 
Rkt Container Engine
Thuc Le Dong
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
Akihiro Suda
 
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
Akihiro Suda
 
[KubeCon EU 2020] containerd Deep Dive
Akihiro Suda
 
Tech Talk - Vagrant
Thomas Krille
 
Techtalks: taking docker to production
muayyad alsadi
 
Rootless Containers & Unresolved issues
Akihiro Suda
 
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Docker 初探,實驗室中的運貨鯨
Ruoshi Ling
 
Usernetes: Kubernetes as a non-root user
Akihiro Suda
 
Ansible docker
QNIB Solutions
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
Introduction to CRI and OCI
HungWei Chiu
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
dotCloud
 
DCSF 19 Deploying Rootless buildkit on Kubernetes
Docker, Inc.
 
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
Akihiro Suda
 
The State of Rootless Containers
Akihiro Suda
 
Docker engine - Indroduc
Al Gifari
 
Startup Containers in Lightning Speed with Lazy Image Distribution
Kohei Tokunaga
 

Viewers also liked (8)

PDF
KubeCon EU 2016: "rktnetes": what's new with container runtimes and Kubernetes
KubeAcademy
 
PDF
Getting Started with Containers
Scott Lowe
 
PDF
containerd and what it means for the container ecosystem
Justin Steele
 
PPTX
Docker for the new Era: Introducing Docker,its components and tools
Ramit Surana
 
PPTX
Python at Facebook
Angelo Failla
 
PDF
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Kai Wähner
 
PDF
Basic docker for developer
Weerayut Hongsa
 
PPTX
Lxc – next gen virtualization for cloud intro (cloudexpo)
Boden Russell
 
KubeCon EU 2016: "rktnetes": what's new with container runtimes and Kubernetes
KubeAcademy
 
Getting Started with Containers
Scott Lowe
 
containerd and what it means for the container ecosystem
Justin Steele
 
Docker for the new Era: Introducing Docker,its components and tools
Ramit Surana
 
Python at Facebook
Angelo Failla
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Kai Wähner
 
Basic docker for developer
Weerayut Hongsa
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Boden Russell
 
Ad

Similar to App container rkt (20)

PPTX
Introduction to Docker
Nissan Dookeran
 
PPTX
Container & kubernetes
Ted Jung
 
PPTX
Dockerizing a Symfony2 application
Roman Rodomansky
 
PDF
LibOS as a regression test framework for Linux networking #netdev1.1
Hajime Tazaki
 
PPTX
Why you’re going to fail running java on docker!
Red Hat Developers
 
PDF
Develop QNAP NAS App by Docker
Terry Chen
 
PPTX
Introduction to docker
Christophe Muller
 
PDF
GDG Cloud Iasi - Docker For The Busy Developer.pdf
athlonica
 
PDF
Delivering Docker & K3s worloads to IoT Edge devices
Ajeet Singh Raina
 
PDF
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
kanedafromparis
 
PDF
Automate drupal deployments with linux containers, docker and vagrant
Ricardo Amaro
 
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
PDF
Security of Linux containers in the cloud
Dobrica Pavlinušić
 
PDF
Genode Compositions
Vasily Sartakov
 
PDF
CoreOS @ gluecon 2015
ifup
 
PDF
Kubernetes laravel and kubernetes
William Stewart
 
PDF
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
PDF
Real-World Docker: 10 Things We've Learned
RightScale
 
PDF
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Imesh Gunaratne
 
PDF
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Habeeb Rahman
 
Introduction to Docker
Nissan Dookeran
 
Container & kubernetes
Ted Jung
 
Dockerizing a Symfony2 application
Roman Rodomansky
 
LibOS as a regression test framework for Linux networking #netdev1.1
Hajime Tazaki
 
Why you’re going to fail running java on docker!
Red Hat Developers
 
Develop QNAP NAS App by Docker
Terry Chen
 
Introduction to docker
Christophe Muller
 
GDG Cloud Iasi - Docker For The Busy Developer.pdf
athlonica
 
Delivering Docker & K3s worloads to IoT Edge devices
Ajeet Singh Raina
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
kanedafromparis
 
Automate drupal deployments with linux containers, docker and vagrant
Ricardo Amaro
 
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
Security of Linux containers in the cloud
Dobrica Pavlinušić
 
Genode Compositions
Vasily Sartakov
 
CoreOS @ gluecon 2015
ifup
 
Kubernetes laravel and kubernetes
William Stewart
 
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
Real-World Docker: 10 Things We've Learned
RightScale
 
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Imesh Gunaratne
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Habeeb Rahman
 
Ad

Recently uploaded (20)

PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PPTX
UNIT III CONTROL OF PARTICULATE CONTAMINANTS
sundharamm
 
PPTX
Fluid statistics and Numerical on pascal law
Ravindra Kolhe
 
PDF
July 2025 - Top 10 Read Articles in Network Security & Its Applications.pdf
IJNSA Journal
 
PPTX
Basics of Auto Computer Aided Drafting .pptx
Krunal Thanki
 
PDF
The Complete Guide to the Role of the Fourth Engineer On Ships
Mahmoud Moghtaderi
 
PPTX
Water resources Engineering GIS KRT.pptx
Krunal Thanki
 
PDF
Air -Powered Car PPT by ER. SHRESTH SUDHIR KOKNE.pdf
SHRESTHKOKNE
 
PPT
IISM Presentation.ppt Construction safety
lovingrkn
 
PPTX
Introduction to Fluid and Thermal Engineering
Avesahemad Husainy
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
PPTX
filteration _ pre.pptx 11111110001.pptx
awasthivaibhav825
 
PPTX
Online Cab Booking and Management System.pptx
diptipaneri80
 
PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PDF
Web Technologies - Chapter 3 of Front end path.pdf
reemaaliasker
 
PPTX
Precedence and Associativity in C prog. language
Mahendra Dheer
 
PPTX
00-ClimateChangeImpactCIAProcess_PPTon23.12.2024-ByDr.VijayanGurumurthyIyer1....
praz3
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
PDF
Non Text Magic Studio Magic Design for Presentations L&P.pdf
rajpal7872
 
PDF
勉強会資料_An Image is Worth More Than 16x16 Patches
NABLAS株式会社
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
UNIT III CONTROL OF PARTICULATE CONTAMINANTS
sundharamm
 
Fluid statistics and Numerical on pascal law
Ravindra Kolhe
 
July 2025 - Top 10 Read Articles in Network Security & Its Applications.pdf
IJNSA Journal
 
Basics of Auto Computer Aided Drafting .pptx
Krunal Thanki
 
The Complete Guide to the Role of the Fourth Engineer On Ships
Mahmoud Moghtaderi
 
Water resources Engineering GIS KRT.pptx
Krunal Thanki
 
Air -Powered Car PPT by ER. SHRESTH SUDHIR KOKNE.pdf
SHRESTHKOKNE
 
IISM Presentation.ppt Construction safety
lovingrkn
 
Introduction to Fluid and Thermal Engineering
Avesahemad Husainy
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
filteration _ pre.pptx 11111110001.pptx
awasthivaibhav825
 
Online Cab Booking and Management System.pptx
diptipaneri80
 
Zero Carbon Building Performance standard
BassemOsman1
 
Web Technologies - Chapter 3 of Front end path.pdf
reemaaliasker
 
Precedence and Associativity in C prog. language
Mahendra Dheer
 
00-ClimateChangeImpactCIAProcess_PPTon23.12.2024-ByDr.VijayanGurumurthyIyer1....
praz3
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
rajpal7872
 
勉強会資料_An Image is Worth More Than 16x16 Patches
NABLAS株式会社
 

App container rkt