Build Moby from GitHub sources


#1

Hello!
I just wanted to patch dockerd and to run it.
So, I’ve cloned https://github.com/moby/moby and executed such kind of commands to build and run my patched dockerd.

# Building dockerd
root@ubuntu-xenial:~/moby# systemctl start docker
root@ubuntu-xenial:~/moby# make
...
root@ubuntu-xenial:~/moby# systemctl stop docker

# Running of builded dockerd
root@ubuntu-xenial:~/moby# cd bundles/
root@ubuntu-xenial:~/moby/bundles# ./binary-daemon/dockerd
INFO[2017-09-20T13:01:39.647651349Z] libcontainerd: new containerd process, pid: 6413 
WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=1048576
INFO[2017-09-20T13:01:40.663880382Z] [graphdriver] using prior storage driver: aufs 
INFO[2017-09-20T13:01:40.690718484Z] Graph migration to content-addressability took 0.00 seconds 
WARN[2017-09-20T13:01:40.691160071Z] Your kernel does not support swap memory limit 
WARN[2017-09-20T13:01:40.691255948Z] Your kernel does not support cgroup rt period 
WARN[2017-09-20T13:01:40.691372765Z] Your kernel does not support cgroup rt runtime 
INFO[2017-09-20T13:01:40.691909525Z] Loading containers: start.                   
INFO[2017-09-20T13:01:40.809145234Z] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address 
INFO[2017-09-20T13:01:40.843636616Z] Loading containers: done.                    
INFO[2017-09-20T13:01:40.884713044Z] Docker daemon                                 commit=149f3ac graphdriver(s)=aufs version=17.06.0-dev
INFO[2017-09-20T13:01:40.884814711Z] Daemon has completed initialization          
INFO[2017-09-20T13:01:40.903378545Z] API listen on /var/run/docker.sock

It compiled successfully, but I’m not able to run any container: I get error like this:

# Trying to run some container in other terminal
root@ubuntu-xenial:~/moby/bundles/binary-daemon# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
95309415213f        ubuntu              "bash"                   About an hour ago   Created                                 heuristic_kilby
0b3a519b622c        nginx               "nginx -g 'daemon ..."   17 hours ago        Created             80/tcp              peaceful_torvalds
root@ubuntu-xenial:~/moby/bundles/binary-daemon# docker start -i 95309415213f
Error response from daemon: oci runtime error: target os  mismatch with current os linux
ERRO[0000] error waiting for container: context canceled
  1. What is the right algorithm to build and run Docker containers using Moby?
  2. How cat I resolve this kind of error?
  3. Is it possible to do such kind of build&run on Windows 10/Windows Server 2016?