SlideShare a Scribd company logo
Minimum Container environment
Yuki Nishiwaki
What’s Container
image#2
Linux Kernel
image#1
process
container A
Warden
LXC
MINCS
cgroupsnamespacenetfilter netlink
process
NW
Isorated
process
Software to create container
It’s just process be running on the
same host as containerising software
like docker.
But that process called as container
is isolated by the feature linux kernel
provided than host machine.
Docker is just one of the software to
create/control isolated
process(container)
Root namespace
Docker !== Container
$ docker ps
docker-containerd-shim
docker-containerd-shim
docker-containerd-shim
dockerd
docker-containerd
/var/run/docker.sock
Docker
Bit interesting behavior of Docker
Docker try to ensure container status as config in init
stop initialising running
This container should
start with such a
configuration.
If docker fail to ensure container as
configuration like failing to bind port,
docker restart to do initialisation process
Docker restart normal procedure
port: 7000
port: 7000
port: 7001
port: 8080
port: 80
port: 7000
port: 7000
port: 7001
port: 8080
port: 80
running
runningstop initilising
initilising
stop
Restart
running
--restart
--restart
Docker failed to start due to one of containers
port: 7000
port: 7000
port: 7001
port: 8080
port: 80
runningstop initilising
initilising
Binding failed due to
conflicting of port
Container initialisation
failed due to network
error
stop
infinite
$ docker ps
--restart
--restart
I can’t “docker ps”, means docker
control plane could be dead
If docker don’t respond
1. check if dockerd is restarting repeatedly
2. if yes, remove the existing resource
(/var/lib/docker/volumes, networks...)
What’s MINCS
❖ Minimum Container Shellscripts
❖ Consisit of all pure shellscripts
❖ The number of all lines
➢ 3250 lines
It’s easier to understand the basic consept
than other container management tool
How container
is managed/created
How to install MINCS
$ git clone https://github.com/mhiramat/mincs.git
It was supposed to finish with this one line…..
Not working …...
vagrant@vagrant:~/mincs$ sudo ./minc bash
unshare: invalid option -- 'p'
Usage:
unshare [options] <program> [args...]
unshare command is needed to replace with other
~:$ git clone https://github.com/mirror/busybox.git
~:$ cd busybox
~/busybox:$ make config
require the user to fill with many configuration items….
~/busybox:$ make install
~/busybox:$ mv _install/bin /bin/busybox
Change minc-exec script as following
diff --git a/libexec/minc-exec b/libexec/minc-exec
index 834b4e0..a5a1b8c 100755
--- a/libexec/minc-exec
+++ b/libexec/minc-exec
@@ -174,4 +174,4 @@ cd /
UNSHARE_OPT=
# Enter new namespace and exec command
[ "$MINC_NOPRIV" ] && UNSHARE_OPT=--map-root-user
-$IP_NETNS unshare $UNSHARE_OPT -iumpf $LIBEXEC/`basename $0` "$@"
+$IP_NETNS busybox unshare $UNSHARE_OPT -iumpf $LIBEXEC/`basename
$0` "$@"
1. Try to create container
$ sudo ./minc bash
vagrant@vagrant-ubuntu-trusty:~/mincs$ sudo ./minc bash # <- enter in container
mount: warning: /tmp/minc9215-334yCm/root/proc/sys seems to be mounted read-only.
mount: warning: /tmp/minc9215-334yCm/root/proc/sysrq-trigger seems to be mounted read-only.
mount: warning: /tmp/minc9215-334yCm/root/proc/irq seems to be mounted read-only.
mount: warning: /tmp/minc9215-334yCm/root/proc/bus seems to be mounted read-only.
root@vagrant-ubuntu-trusty:/# echo test >> test
root@vagrant-ubuntu-trusty:/# cat /test
test #<- There is /test files
root@vagrant-ubuntu-trusty:/# exit
exit #<- get out of container
vagrant@vagrant-ubuntu-trusty:~/mincs$ cat /test
cat: /test: No such file or directory # <- There is no /test file (directory tree is separated)
2. Try to use image management
vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten import ubuntu.tar.gz
mincs/marten: 1: mincs/marten: jq: not found # <- need jq package
vagrant@vagrant-ubuntu-trusty:~$ sudo apt-get install jq
vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten import ubuntu.tar.gz
Importing image: ubuntu
jq: error: Cannot index number with string
parse error: Invalid numeric literal #<- This is bug… it can’t import the images to contain multiples
# https://github.com/mhiramat/mincs/issues/8
vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten import ubuntu_latest.tar.gz
Importing image: ubuntu
9d2e5c12a9428108649812c24645eba52c030507a74c891984b3fb7f218d7690
………….
9177e32309d14441f30648db6ba1641800c79d959d63dddc0ab7da673cd6acd9
9d2e5c12a9428108649812c24645eba52c030507a74c891984b3fb7f218d7690
vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten images #<- it works
3. Try to create the container form images
vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten images
ID SIZE NAME
06bd4c05b6dc 20K (noname)
72a988653a4a 84K (noname)
891a3a3af630 138M (noname)
9177e32309d1 16K (noname)
9d2e5c12a942 16K ubuntu
vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/minc -r ubuntu bash
mount: special device overlayfs does not exist #<- I need fix, somehow overlayfs is enabled since kernel 3.18
To reuse this, run: mincs/minc -t 3c94cdd1629d
vagrant@vagrant-ubuntu-trusty:~/mincs$ uname -r
3.13.0-24-generic #<- not supported for overlayfs
vagrant@vagrant-ubuntu-trusty:~$ sudo apt-get install linux-generic-lts-vivid linux-headers-generic-lts-vivid
vagrant@vagrant-ubuntu-trusty:~$ reboot
3. Try to create the container form images
root@vagrant-ubuntu-trusty:/home/vagrant/mincs# ./minc -r ubuntu
mount: wrong fs type, bad option, bad superblock on overlayfs,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so
root@vagrant-ubuntu-trusty:/home/vagrant/mincs# sudo dmesg | tail -f
[ 1383.505546] overlayfs: failed to resolve
'/var/lib/mincs/images/9d2e5c12a9428108649812c24645eba52c030507a74c891984b3fb7f218d7690/root:/var
/lib/mincs/images/9177e32309d14441f30648db6ba1641800c79d959d63dddc0ab7da673cd6acd9/root:/var/lib/
mincs/images/06bd4c05b6dcfa6e669d02f4150b7842166a97ce536fbb0a98f66d2c4566c37e/root:/var/lib/mincs
/images/72a988653a4a1802b617429efccfb972f0693fa6665fed9d27d912cc23590670/root:/var/lib/mincs/imag
es/891a3a3af630e0853915722c47dc1a7002d2ea0218273456a12014fca609fc7d/root': -2
[ 1383.508533] overlayfs: missing upperdir or lowerdir or workdir
In the case of overlayfs, we can’t
use multiple base images with
kernel version less than 4.0.
since kernel 4.0, we can use
multiple images as lowerdir.
In a nutshel
Create container with no additaional image
1. rebuild latest busybox
2. correct minc-exec a little
Import docker image
1. image should be single images ( it’s ok to consist of multiple images )
Create container from the image to be imported from docker
1. kernel version should be updated over 3.18
2. merge multiple images into one image if kernel version is less than 4 ← I added
https://github.com/ukinau/mincs/commit/d94eb4fed4626e2f934a3ddc44912e8c2b28b269
Good articles
The slide original developer
- http://www.slideshare.net/mhiramat/mincs-containers-in-the-shell-script
Can’t support multiple lowerlayers in overlayfs
- http://queforum.com/unix-linux-basics/1008603-linux-how-use-multiple-lower-layers-overlayfs.html
- http://stackoverflow.com/questions/31044982/how-to-use-multiple-lower-layers-in-overlayfs
Support multiple lowerlayers in overlayfs since kernel 4.0 version
- https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt

More Related Content

What's hot

Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
Soshi Nemoto
 
Steam Learn: Composer
Steam Learn: ComposerSteam Learn: Composer
Steam Learn: Composer
inovia
 
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service managementA journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
Lubomir Rintel
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
Soshi Nemoto
 
Linux Containers (LXC)
Linux Containers (LXC)Linux Containers (LXC)
Linux Containers (LXC)
Vladimir Melnic
 
NAS Botnet Revealed - Mining Bitcoin
NAS Botnet Revealed - Mining Bitcoin NAS Botnet Revealed - Mining Bitcoin
NAS Botnet Revealed - Mining Bitcoin
Davide Cioccia
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
Sam Kim
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
 
Dtalk shell
Dtalk shellDtalk shell
Dtalk shell
Miha Mencin
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
Sam Kim
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
Toshiaki Baba
 
Message queue demo
Message queue demoMessage queue demo
Message queue demo
DataArt
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
Walter Heck
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell script
Kenny (netman)
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
Toshiaki Baba
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
dantleech
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
Mohammed Farrag
 
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
Puppet
 

What's hot (20)

Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
Steam Learn: Composer
Steam Learn: ComposerSteam Learn: Composer
Steam Learn: Composer
 
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service managementA journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
 
Linux Containers (LXC)
Linux Containers (LXC)Linux Containers (LXC)
Linux Containers (LXC)
 
NAS Botnet Revealed - Mining Bitcoin
NAS Botnet Revealed - Mining Bitcoin NAS Botnet Revealed - Mining Bitcoin
NAS Botnet Revealed - Mining Bitcoin
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
 
Dtalk shell
Dtalk shellDtalk shell
Dtalk shell
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
 
Message queue demo
Message queue demoMessage queue demo
Message queue demo
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell script
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
 
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
 

Similar to Pursue container architecture with mincs

Docker practice
Docker practiceDocker practice
Docker practice
wonyong hwang
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
Michelle Holley
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
Thierry Gayet
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
Docker, Inc.
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
Henryk Konsek
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
Ben Hall
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
Ricardo Amaro
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
Bryan McLellan
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
Evans Ye
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Christophe Muller
 
Dockerfish-Tutorial
Dockerfish-TutorialDockerfish-Tutorial
Dockerfish-Tutorial
Brian Hood
 
Ubic-public
Ubic-publicUbic-public
Docker perl build
Docker perl buildDocker perl build
Docker perl build
Workhorse Computing
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
Alexandre Salomé
 
Docker - A Ruby Introduction
Docker - A Ruby IntroductionDocker - A Ruby Introduction
Docker - A Ruby Introduction
Tyler Johnston
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
Bo-Yi Wu
 

Similar to Pursue container architecture with mincs (20)

Docker practice
Docker practiceDocker practice
Docker practice
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Dockerfish-Tutorial
Dockerfish-TutorialDockerfish-Tutorial
Dockerfish-Tutorial
 
Ubic-public
Ubic-publicUbic-public
Ubic-public
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Docker - A Ruby Introduction
Docker - A Ruby IntroductionDocker - A Ruby Introduction
Docker - A Ruby Introduction
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 

Recently uploaded

5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
AlvianRamadhani5
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
Prakhyath Rai
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
Shiny Christobel
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
uqyfuc
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
AI-Based Home Security System : Home security
AI-Based Home Security System : Home securityAI-Based Home Security System : Home security
AI-Based Home Security System : Home security
AIRCC Publishing Corporation
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
Addu25809
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 

Recently uploaded (20)

5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
AI-Based Home Security System : Home security
AI-Based Home Security System : Home securityAI-Based Home Security System : Home security
AI-Based Home Security System : Home security
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 

Pursue container architecture with mincs

  • 2. What’s Container image#2 Linux Kernel image#1 process container A Warden LXC MINCS cgroupsnamespacenetfilter netlink process NW Isorated process Software to create container It’s just process be running on the same host as containerising software like docker. But that process called as container is isolated by the feature linux kernel provided than host machine. Docker is just one of the software to create/control isolated process(container) Root namespace
  • 3. Docker !== Container $ docker ps docker-containerd-shim docker-containerd-shim docker-containerd-shim dockerd docker-containerd /var/run/docker.sock Docker
  • 5. Docker try to ensure container status as config in init stop initialising running This container should start with such a configuration. If docker fail to ensure container as configuration like failing to bind port, docker restart to do initialisation process
  • 6. Docker restart normal procedure port: 7000 port: 7000 port: 7001 port: 8080 port: 80 port: 7000 port: 7000 port: 7001 port: 8080 port: 80 running runningstop initilising initilising stop Restart running --restart --restart
  • 7. Docker failed to start due to one of containers port: 7000 port: 7000 port: 7001 port: 8080 port: 80 runningstop initilising initilising Binding failed due to conflicting of port Container initialisation failed due to network error stop infinite $ docker ps --restart --restart I can’t “docker ps”, means docker control plane could be dead
  • 8. If docker don’t respond 1. check if dockerd is restarting repeatedly 2. if yes, remove the existing resource (/var/lib/docker/volumes, networks...)
  • 9. What’s MINCS ❖ Minimum Container Shellscripts ❖ Consisit of all pure shellscripts ❖ The number of all lines ➢ 3250 lines It’s easier to understand the basic consept than other container management tool How container is managed/created
  • 10. How to install MINCS $ git clone https://github.com/mhiramat/mincs.git It was supposed to finish with this one line…..
  • 11. Not working …... vagrant@vagrant:~/mincs$ sudo ./minc bash unshare: invalid option -- 'p' Usage: unshare [options] <program> [args...]
  • 12. unshare command is needed to replace with other ~:$ git clone https://github.com/mirror/busybox.git ~:$ cd busybox ~/busybox:$ make config require the user to fill with many configuration items…. ~/busybox:$ make install ~/busybox:$ mv _install/bin /bin/busybox
  • 13. Change minc-exec script as following diff --git a/libexec/minc-exec b/libexec/minc-exec index 834b4e0..a5a1b8c 100755 --- a/libexec/minc-exec +++ b/libexec/minc-exec @@ -174,4 +174,4 @@ cd / UNSHARE_OPT= # Enter new namespace and exec command [ "$MINC_NOPRIV" ] && UNSHARE_OPT=--map-root-user -$IP_NETNS unshare $UNSHARE_OPT -iumpf $LIBEXEC/`basename $0` "$@" +$IP_NETNS busybox unshare $UNSHARE_OPT -iumpf $LIBEXEC/`basename $0` "$@"
  • 14. 1. Try to create container $ sudo ./minc bash vagrant@vagrant-ubuntu-trusty:~/mincs$ sudo ./minc bash # <- enter in container mount: warning: /tmp/minc9215-334yCm/root/proc/sys seems to be mounted read-only. mount: warning: /tmp/minc9215-334yCm/root/proc/sysrq-trigger seems to be mounted read-only. mount: warning: /tmp/minc9215-334yCm/root/proc/irq seems to be mounted read-only. mount: warning: /tmp/minc9215-334yCm/root/proc/bus seems to be mounted read-only. root@vagrant-ubuntu-trusty:/# echo test >> test root@vagrant-ubuntu-trusty:/# cat /test test #<- There is /test files root@vagrant-ubuntu-trusty:/# exit exit #<- get out of container vagrant@vagrant-ubuntu-trusty:~/mincs$ cat /test cat: /test: No such file or directory # <- There is no /test file (directory tree is separated)
  • 15. 2. Try to use image management vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten import ubuntu.tar.gz mincs/marten: 1: mincs/marten: jq: not found # <- need jq package vagrant@vagrant-ubuntu-trusty:~$ sudo apt-get install jq vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten import ubuntu.tar.gz Importing image: ubuntu jq: error: Cannot index number with string parse error: Invalid numeric literal #<- This is bug… it can’t import the images to contain multiples # https://github.com/mhiramat/mincs/issues/8 vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten import ubuntu_latest.tar.gz Importing image: ubuntu 9d2e5c12a9428108649812c24645eba52c030507a74c891984b3fb7f218d7690 …………. 9177e32309d14441f30648db6ba1641800c79d959d63dddc0ab7da673cd6acd9 9d2e5c12a9428108649812c24645eba52c030507a74c891984b3fb7f218d7690 vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten images #<- it works
  • 16. 3. Try to create the container form images vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/marten images ID SIZE NAME 06bd4c05b6dc 20K (noname) 72a988653a4a 84K (noname) 891a3a3af630 138M (noname) 9177e32309d1 16K (noname) 9d2e5c12a942 16K ubuntu vagrant@vagrant-ubuntu-trusty:~$ sudo mincs/minc -r ubuntu bash mount: special device overlayfs does not exist #<- I need fix, somehow overlayfs is enabled since kernel 3.18 To reuse this, run: mincs/minc -t 3c94cdd1629d vagrant@vagrant-ubuntu-trusty:~/mincs$ uname -r 3.13.0-24-generic #<- not supported for overlayfs vagrant@vagrant-ubuntu-trusty:~$ sudo apt-get install linux-generic-lts-vivid linux-headers-generic-lts-vivid vagrant@vagrant-ubuntu-trusty:~$ reboot
  • 17. 3. Try to create the container form images root@vagrant-ubuntu-trusty:/home/vagrant/mincs# ./minc -r ubuntu mount: wrong fs type, bad option, bad superblock on overlayfs, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program) In some cases useful info is found in syslog - try dmesg | tail or so root@vagrant-ubuntu-trusty:/home/vagrant/mincs# sudo dmesg | tail -f [ 1383.505546] overlayfs: failed to resolve '/var/lib/mincs/images/9d2e5c12a9428108649812c24645eba52c030507a74c891984b3fb7f218d7690/root:/var /lib/mincs/images/9177e32309d14441f30648db6ba1641800c79d959d63dddc0ab7da673cd6acd9/root:/var/lib/ mincs/images/06bd4c05b6dcfa6e669d02f4150b7842166a97ce536fbb0a98f66d2c4566c37e/root:/var/lib/mincs /images/72a988653a4a1802b617429efccfb972f0693fa6665fed9d27d912cc23590670/root:/var/lib/mincs/imag es/891a3a3af630e0853915722c47dc1a7002d2ea0218273456a12014fca609fc7d/root': -2 [ 1383.508533] overlayfs: missing upperdir or lowerdir or workdir In the case of overlayfs, we can’t use multiple base images with kernel version less than 4.0. since kernel 4.0, we can use multiple images as lowerdir.
  • 18. In a nutshel Create container with no additaional image 1. rebuild latest busybox 2. correct minc-exec a little Import docker image 1. image should be single images ( it’s ok to consist of multiple images ) Create container from the image to be imported from docker 1. kernel version should be updated over 3.18 2. merge multiple images into one image if kernel version is less than 4 ← I added https://github.com/ukinau/mincs/commit/d94eb4fed4626e2f934a3ddc44912e8c2b28b269
  • 19. Good articles The slide original developer - http://www.slideshare.net/mhiramat/mincs-containers-in-the-shell-script Can’t support multiple lowerlayers in overlayfs - http://queforum.com/unix-linux-basics/1008603-linux-how-use-multiple-lower-layers-overlayfs.html - http://stackoverflow.com/questions/31044982/how-to-use-multiple-lower-layers-in-overlayfs Support multiple lowerlayers in overlayfs since kernel 4.0 version - https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt