Slide 10
Slide 10 text
ホストの Docker を操作 ☠
10
$ kubectl run -it --rm --restart=Never --overrides '
{
"spec": {
"nodeName": "$NODE_NAME",
"containers": [ {
"name": "docker", "image": "docker", "stdin": true, "tty": true,
"command": ["/bin/sh"],
"securityContext": {"capabilities": {"add": ["SYS_PTRACE"]}},
"volumeMounts":
[ {"name": "docker-sock", "mountPath": "/var/run/docker.sock"} ]
} ],
"volumes": [
{"name": "docker-sock", "hostPath": {"path": "/var/run/docker.sock"}}
]
}
}
' mydocker --image docker # ホストの Docker ソケットをマウントして操作