mirror of
https://github.com/p8952/bocker.git
synced 2025-11-09 03:04:00 +01:00
Make each isolation level in bocker_run more clear
This commit is contained in:
parent
1f48b32c42
commit
f33b31b3d6
7
bocker
7
bocker
@ -78,8 +78,11 @@ function bocker_run() { #HELP Create a container:\nBOCKER run <image_id> <comman
|
|||||||
cgcreate -g "$cgroups:/$uuid"
|
cgcreate -g "$cgroups:/$uuid"
|
||||||
cgset -r cpuset.cpus=0-1 "$uuid" && cgset -r cpuset.mems=0 "$uuid"
|
cgset -r cpuset.cpus=0-1 "$uuid" && cgset -r cpuset.mems=0 "$uuid"
|
||||||
cgset -r memory.limit_in_bytes=512000000 "$uuid"
|
cgset -r memory.limit_in_bytes=512000000 "$uuid"
|
||||||
cgexec -g "$cgroups:$uuid" ip netns exec netns_"$uuid" "unshare" -fmuip --mount-proc "chroot" \
|
cgexec -g "$cgroups:$uuid" \
|
||||||
"$btrfs_path/$uuid" /bin/sh -c "/bin/mount -t proc proc /proc && $cmd" \
|
ip netns exec netns_"$uuid" \
|
||||||
|
unshare -fmuip --mount-proc \
|
||||||
|
chroot "$btrfs_path/$uuid" \
|
||||||
|
/bin/sh -c "/bin/mount -t proc proc /proc && $cmd" \
|
||||||
2>&1 | tee "$btrfs_path/$uuid/$uuid.log" || true
|
2>&1 | tee "$btrfs_path/$uuid/$uuid.log" || true
|
||||||
ip link del dev veth0_"$uuid"
|
ip link del dev veth0_"$uuid"
|
||||||
ip netns del netns_"$uuid"
|
ip netns del netns_"$uuid"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user