Archive for the ‘ Docker ’ Category

Docker: get relation between container and interface veth

The idea is to receive the index of the next interface. # Get veth interface: MY_CONTAINER_NAME=”mysql_server_1″ LINK_INDEX=`docker exec -it $MY_CONTAINER_NAME ip a l eth0 | awk -F “:” ‘{if (NR==1) print $1+1}’` ip link ls | grep “^$LINK_INDEX” | awk -F”:” ‘{ gsub (” “, “”, $2); print $2}’ Now you can easily observe the […]

Read more...

Docker (>= 1.8), swappiness

docker run -it -v /host_storage/mms_condor:/storage_inside_docker \ –name=”condor_swap_30″ –memory-swappiness=”30″ \ –oom-kill-disable=true -c=1024 -m 64M 7322fbe74aa5 –oom-kill-disable=true|false: Whether to disable OOM Killer for the container or not. –memory-swappiness=””: Tune a container’s memory swappiness behavior. Accepts an integer between 0 and 100. –memory-swap=””: Total memory limit (memory + swap, format: , where unit = b, k, m or […]

Read more...

Docker, storage isolation >= 1.8

lvcreate -n pool0 -L 20G dockers lvcreate -n pool0meta -L 1G dockers lvconvert –type thin-pool –poolmetadata dockers/pool0meta dockers/pool0 # check how it is working? [root@db7 ~]# docker daemon –storage-opt dm.thinpooldev=/dev/mapper/dockers-pool0 Install to systemctl echo ‘OPTIONS=”–storage-opt dm.thinpooldev=/dev/mapper/dockers-pool0″‘ >> /etc/sysconfig/docker vi /usr/lib/systemd/system/docker.service [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network.target docker.socket Requires=docker.socket [Service] EnvironmentFile=-/etc/sysconfig/docker Type=notify ExecStart=/usr/bin/docker daemon -H […]

Read more...