Unable to run Docker in Docker in CircleCI

docker

#1

Hello, I am currently working on an internal tool for docker deployment. The basic premise of the tool is that it issues docker commands remotely over SSH. For integration tests, I have created a docker container based on phusion/baseimage which runs sshd and docker. This docker container works great locally, but when I try to run it as part of my build on CircleCI, the Docker instance inside the container fails to start. Logs contain the following error messages:

time="2016-05-19T18:01:41.230172598Z" level=warning msg="Your kernel does not support cgroup memory limit"
time="2016-05-19T18:01:41.230209894Z" level=warning msg="Unable to find cpu cgroup in mounts"
time="2016-05-19T18:01:41.230225321Z" level=warning msg="Unable to find blkio cgroup in mounts"
time="2016-05-19T18:01:41.230238334Z" level=warning msg="Unable to find cpuset cgroup in mounts"
time="2016-05-19T18:01:41.230351158Z" level=warning msg="mountpoint for pids not found"
time="2016-05-19T18:01:41.251594320Z" level=fatal msg="Error starting daemon: Devices cgroup isn't mounted"
time="2016-05-19T18:01:42.310371386Z" level=info msg="previous instance of containerd still alive (176)"
time="2016-05-19T18:01:42.312660513Z" level=info msg="[graphdriver] using prior storage driver \"btrfs\""
time="2016-05-19T18:01:42.314965865Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2016-05-19T18:01:42.316556701Z" level=warning msg="Running modprobe bridge br_netfilter failed with message: modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-86-generic/modules.dep.bin'\nmodprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-86-generic/modules.dep.bin'\n, error: exit status 1"
time="2016-05-19T18:01:42.317729380Z" level=warning msg="Running modprobe nf_nat failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-86-generic/modules.dep.bin'`, error: exit status 1"
time="2016-05-19T18:01:42.318818579Z" level=warning msg="Running modprobe xt_conntrack failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-86-generic/modules.dep.bin'`, error: exit status 1"
time="2016-05-19T18:01:42.372874957Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.18.0.0/16. Daemon option --bip can be used to set a preferred IP address"
time="2016-05-19T18:01:42.404341307Z" level=warning msg="Your kernel does not support cgroup memory limit"
time="2016-05-19T18:01:42.404379059Z" level=warning msg="Unable to find cpu cgroup in mounts"
time="2016-05-19T18:01:42.404398554Z" level=warning msg="Unable to find blkio cgroup in mounts"
time="2016-05-19T18:01:42.404414300Z" level=warning msg="Unable to find cpuset cgroup in mounts"
time="2016-05-19T18:01:42.404521836Z" level=warning msg="mountpoint for pids not found"
time="2016-05-19T18:01:42.447439188Z" level=fatal msg="Error starting daemon: Devices cgroup isn't mounted"

I should mention that I am running my container with the --privileged flag, but my guess is that there are further constraints on docker containers running on CircleCI. From what little I could find online, the probable cause is that docker is executing in the lxc environment on Circle while the native environment locally. Is this correct? And is there any workaround? So far the only thing I can come up with is to run our test server externally, which is exactly the thing I want to avoid by using CircleCI. Thanks for the help!


#2