一个bridge诞生时,会有一个mac地址;当向bridge上addif veth2时,bri …
分类存档:Docker
创建新的名字空间
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#define _GNU_SOURCE #include <sched.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <unistd.h> static char child_stack[1048576]; static int child_fn() { printf("PID: %ld\n", (long)getpid()); sleep(100000); return 0; } int main(int ac, char** av) { int ch; int flag = SIGCHLD; while((ch = getopt(ac, av, "pmnuU")) != -1) { switch(ch) { case 'p': flag |= CLONE_NEWPID;break; case 'm': flag |= CLONE_NEWNS;break; case 'n': flag |= CLONE_NEWNET;break; case 'u': flag |= CLONE_NEWUTS;break; case 'U': flag |= CLONE_NEWUSER;break; } } pid_t child_pid = clone(child_fn, child_stack+1048576, flag, NULL); printf("clone() = %ld\n", (long)child_pid); waitpid(child_pid, NULL, 0); return 0; } |
功能: 创建新的名字空间,并使得进程处于sl …
docker 之 exec失败的问题
环境:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# docker info Containers: 56 Running: 33 Paused: 0 Stopped: 23 Images: 31 Server Version: 1.12.5 Storage Driver: devicemapper Pool Name: data-docker_thinpool Pool Blocksize: 524.3 kB Base Device Size: 32.21 GB Backing Filesystem: xfs Data file: Metadata file: Data Space Used: 516.2 GB Data Space Total: 644.2 GB Data Space Available: 128.1 GB Metadata Space Used: 45.47 MB Metadata Space Total: 16.98 GB Metadata Space Available: 16.93 GB Thin Pool Minimum Free Space: 64.42 GB Udev Sync Supported: true Deferred Removal Enabled: true Deferred Deletion Enabled: false Deferred Deleted Device Count: 0 Library Version: 1.02.135-RHEL7 (2016-11-16) Logging Driver: journald Cgroup Driver: cgroupfs Plugins: Volume: local Network: host bridge null overlay Swarm: inactive Runtimes: runc docker-runc Default Runtime: runc Security Options: seccomp Kernel Version: 3.10.0-514.6.1.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 Number of Docker Hooks: 2 CPUs: 40 Total Memory: 94.14 GiB Name: VM-2-10-12 ID: NYBE:NZML:4KQQ:PF2J:RXCB:IPPI:Y3BI:CY7E:RVAC:WVWV:VDM2:3EEK Docker Root Dir: /data1/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Insecure Registries: docker-registry.i.bbtfax.com:5000 127.0.0.0/8 Registries: docker.io (secure) |
现象: [crayon …
RUNNING CONTAINERS WITH RUNC
http://www.centosabc.com/archives/1573
cgroup 审计策略
内存子系统 场景: 当你把一个已经占用了1GB内存的进程转移到一个新的cgroup后,新的cgroup看到的该 …
docker 之磁盘限额
docker-ce-17.07.0 版本开始支持overlay2的磁盘配额,该版本 8月29号release了 …
docker之username space
usernamespace在docker中的用法: docker 中可以通过dockerd的 –u …
关于容器oom
缘起: 偶尔有同学反应容器很慢,查看容器状态发现内存没用完了;问题是,oom命名是开启的,为什么不杀进程呢? …
docker & cache
缘起: dubbo-monitor容器swap使用率超过 20% ,而且在不断上升,为什么呢? …
docker swarm 模式下证书过期后daemon无法启动
报错信息:
1 |
Error creating cluster component: error while loading TLS Certificate |
相关文章: https://gi …