development ◦ SSD Firmware development • Red Hat K.K. ◦ GlusterFS, OpenShift support • Canonical Japan K.K. ◦ Ubuntu, OpenStack support Twitter : @shi_wenhan Github: https://github.com/xibuka/bocker
to below URL ◦ https://auth.docker.io/token?service=registry.docker.io&scope=repository :<USER>/<APP>:<ACTION> i. USER/APP: • The repository name, use library this time to get official image ii. ACTION: • [pull, push] iii. E.g. : library/ubuntu:pull,push https://docs.docker.com/registry/spec/auth/token/#requesting-a-token
client to use for the requests in the Authorization header. A Bearer token for OAuth2. Lifetime in second for the token remain valid. UTC time of the token was being issued. https://docs.docker.com/registry/spec/auth/token/#requesting-a-token
◦ An image directly references one or more layers. • digest ◦ One layer content is identified by this hex digest ◦ The hex element is calculated by SHA256 to the layer’s content ▪ It will be changed when the content changes. ◦ Layer can be pulling by https://registry-1.docker.io/v2/library/< images>/blob/<digest> https://docs.docker.com/registry/spec/manifest-v2-2/#image-manifest-field-descriptions https://docs.docker.com/registry/spec/api/#digest-parameter
images. ◦ Copy-on-write snapshots(redirect-on-write is the Btrfs terminology) ◦ Ease of managing Btrfs filesystems, without unmount or restart Docker i. ii. • Use subvolume to save all image layers as a base image ◦ • Use snapshot of a subvolume for container’s filesystem ◦ https://docs.docker.com/storage/storagedriver/btrfs-driver/ $ sudo btrfs device add /dev/svdh /var/lib/docker $ sudo btrfs filesystem balance /var/lib/docker $ sudo btrfs subvolume create /var/bocker/imageA $ sudo btrfs subvolume snapshot /var/bocker/imageA /var/bocker/containerA
only see or use the resources in that namespace (and its child namespaces) Namespace 27 Hostname: cloud Namespace 28 Hostname: native Namespace 29 Hostname: days PID 1 2 3 4(1) 5(1) 6(2)
-a, --all enter all namespaces -t, --target <pid> target process to get namespaces from -m, --mount[=<file>] enter mount namespace -u, --uts[=<file>] enter UTS namespace (hostname etc) -i, --ipc[=<file>] enter System V IPC namespace -n, --net[=<file>] enter network namespace -p, --pid[=<file>] enter pid namespace
proc_27 proc_28 veth0_27 veth1_27 veth0_28 veth1_28 ip link set veth0_[x] master bridge0 ip link set veth0_[x] master bridge0 ip link set veth1_[x] netns ns_[y] ip link set veth1_[x] netns ns_[y]
local ethernet tunnel. • Created in pairs. • Packets transferred on one device are immediately received on the other device. • When either device is DOWN, the state of the veth pair is DOWN ip link add dev veth0_[x] type veth peer name veth1_[x]
<controllers>:<path> Control group which should be added Usage: cgset [-r <name=value>] <cgroup_path> ... Set the parameters of given cgroup(s) -r, --variable <name> Define parameter to set Usage: cgexec [-h] [-g <controllers>:<path>] [--sticky] command [arguments] ... Run the task in given control group(s) -g <controllers>:<path> Control group which should be added
uuid="ps_$(shuf -i 42002-42254 -n 1)" [[ "$(bocker_check "$1")" == 1 ]] && echo "No image named '$1' exists" && exit 1 [[ "$(bocker_check "$uuid")" == 0 ]] && echo "UUID conflict, retrying..." && bocker_run "$@" && return cmd="${@:2}" && ip="$(echo "${uuid: -3}" | sed 's/0//g')" && mac="${uuid: -2}" ip link add dev veth0_"$uuid" type veth peer name veth1_"$uuid" ip link set dev veth0_"$uuid" up ip link set veth0_"$uuid" master bridge0 ip netns add netns_"$uuid" ip link set veth1_"$uuid" netns netns_"$uuid" ip netns exec netns_"$uuid" ip link set dev lo up ip netns exec netns_"$uuid" ip link set veth1_"$uuid" address 02:42:ac:11:00:"$mac" ip netns exec netns_"$uuid" ip addr add 10.0.0."$ip"/24 dev veth1_"$uuid" ip netns exec netns_"$uuid" ip link set dev veth1_"$uuid" up ip netns exec netns_"$uuid" ip route add default via 10.0.0.1 <...>