Containers

CCP1 Day7 Docker

LAB CCP1 CMP2 - Docker Task 3 install MongoDB only needed so we know the commands for our Dockerfile but the image worked only after we added wget and gnupg2, too mongodb 3.4 was not available anymore for ubuntu focal curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list apt update apt install mongodb-org create Docker File # syntax=docker/dockerfile:1 FROM ubuntu:20.

CCP1 Day7 cgroup

LAB CCP1 CMP2 - Containers Task 1 Decided to use own VM instead of ZHAWs Cloudlab. Using same Server I have been using for microk8s. Had to install Docker: tom@microk8s:~$sudo snap install docker Task 2 Check cgroups: tree /sys/fs/cgroup/pids mount -t cgroup -o cpu none /sys/fs/cgroup/cpu #can not be mounted at the same time as mount -t cgroup -o cpu,cpuacct none sys/fs/cgroup/cpu,cpuacct mount | grep gcroup cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct) #To find the cgroup to which a process belongs, run: ps -O cgroup #Or, if you know the PID for the process, run: cat /proc/PID/cgroup Install on Ubuntu #install (on Ubuntu) sudo apt install cgroup-tools hirarchy for cpu and memory #create hirarchy for cpuset subsystem mkdir /sys/fs/cgroup/cpu/red mkdir /sys/fs/cgroup/cpu/blue mkdir /sys/fs/cgroup/memory/lab1 mount -t cgroup -o cpu red /sys/fs/cgroup/cpu/red mount -t cgroup -o cpu blue /sys/fs/cgroup/cpu/blue #don't quite understand why this should be necessary.