Skip to content

Instantly share code, notes, and snippets.

View dqminh's full-sized avatar

Daniel, Dao Quang Minh dqminh

View GitHub Profile
Start(process *Process, hooks map[Event][]string)
-> Start(p, map[Event][]string{
"premount": {"/usr/local/bin/backup-tmp"}, // executed in mnt namespace, before setting any mount points
"postmount": {"/usr/local/bin/restore-tmp"}, // executed in mnt namespace, after setting any mount points, before pivot root
})
3643 ESC[34mINFOESC[0m[84580] GET /containers/e4dfd70059369247043ce49a70d93ea33c28f3a6fa9c613276114145ac9d1d6c/json
3644 ESC[34mINFOESC[0m[84580] +job container_inspect(e4dfd70059369247043ce49a70d93ea33c28f3a6fa9c613276114145ac9d1d6c)
3645 ESC[34mINFOESC[0m[84580] -job container_inspect(e4dfd70059369247043ce49a70d93ea33c28f3a6fa9c613276114145ac9d1d6c) = OK (0)
3646 ESC[31mERROESC[0m[84584] [warning]: couldn't run auplink before unmount: exec: "auplink": executable file not found in $PATH
3647 Untar exit status 1 write /var/lib/docker/devicemapper/devicemapper/data: no space left on device
3648 ESC[34mINFOESC[0m[84584] -job commit(e4dfd70059369247043ce49a70d93ea33c28f3a6fa9c613276114145ac9d1d6c) = ERR (1)
3649 ESC[31mERROESC[0m[84584] Handler for POST /commit returned error: Untar exit status 1 write /var/lib/docker/devicemapper/devicemapper/data: no space left on device
3650 ESC[31mERROESC[0m[84584] HTTP Error: statusCode=500 Untar exit status 1 write /var/lib/docker/devicemapper/devicema
@dqminh
dqminh / README.md
Last active August 29, 2015 14:15
test-zsh-subreaper

zsh with subreaper

  • compile the test program with gcc -o test-zsh main.c
  • run it as test-zsh no-subreaper|subreaper|subreaper-reap

There are 3 modes:

  • no-subreaper: do not invoke the program with PR_SET_CHILD_SUBREAPER, so the child process of zsh will be reaped by something else ( either zsh? or PID 1)
  • subreaper: set PR_SET_CHILD_SUBREAPER, but doesnt reap child processes when receiving SIGCHLD
From e924b34feae782228a7b43286a1cc6f2614f0ae1 Mon Sep 17 00:00:00 2001
From: "Daniel, Dao Quang Minh" <dqminh89@gmail.com>
Date: Sun, 11 Jan 2015 04:07:57 -0500
Subject: [PATCH] the process is sigkilled, return correct exit code
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
---
daemon/execdriver/native/driver.go | 3 ---
vendor/src/github.com/docker/libcontainer/namespaces/exec.go | 9 ++++++++-
2 files changed, 8 insertions(+), 4 deletions(-)
---> Making bundle: tgz (in bundles/1.4.0-dev/tgz)
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/darwin/386/docker-1.4.0-dev.tgz
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/darwin/amd64/docker-1.4.0-dev.tgz
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/freebsd/386/docker-1.4.0-dev.tgz
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/freebsd/amd64/docker-1.4.0-dev.tgz
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/freebsd/arm/docker-1.4.0-dev.tgz
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/linux/386/docker-1.4.0-dev.tgz
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/linux/amd64/docker-1.4.0-dev.tgz
Created tgz: /go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/linux/arm/docker-1.4.0-dev.tgz
cp: cannot stat '/go/src/github.com/docker/docker/bundles/1.4.0-dev/tgz/../cross/windows/386/docker-1.4.0-dev': No such file or directory
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/prctl.h>
pid_t pid1;
void mhandler(int signum) {
fprintf(stderr, "parent got signal %d\n", signum);
root 29602 0.1 0.7 606168 14676 ? Ssl 12:37 0:01 /home/action/bin/docker -d -D --host=unix:///var/run/docker.sock
root 30738 0.1 0.0 3168 324 pts/5 Ss+ 12:56 0:00 \_ sh
root 30813 0.0 0.0 13224 256 ? Ss 12:56 0:00 \_ nsenter-exec --nspid 30738 -- sleep 1000
root 30850 0.5 0.0 3148 72 ? S 12:56 0:00 \_ sleep 1000
@dqminh
dqminh / docker-builder.md
Created November 4, 2014 08:59
builder v2

Builder v2

Current approach

Right now, the builder is very tightly coupled with docker core. The builder has the following roles:

  • process the build context
  • parse Dockerfile into sexp-expressions
  • evaluate individual sexp-expressions which may involves the following job:
  • persist configurations i.e ENV, EXPOSE, VOLUME, etc.
ADD ./composer.json /app/composer.json
RUN composer install
Oct 9 07:41:29 action-dev kernel: [48657.051281] type=1400 audit(1412854889.409:135): apparmor="DENIED" operation="signal" profile="docker-default" pid=9733 comm="bash" requested_mask="send" denied_mask="send" signal=term peer="unconfined"