Ask Your Question

Errors using Docker with Openstack

asked 2013-11-04 18:52:14 -0500

Chris White gravatar image

updated 2013-11-04 20:11:16 -0500

I'm trying to follow the instructions for using Docker as a hypervisor in OpenStack. For the time being i have a Ubuntu 12:04 vm running and have installed Docker (+verified it works).

Now i've checked out the latest devstack from (613fd5591c8, Nov 1st), completed the instructions from tools/docker/ and run the tools/docker/ script.

Next step is to run, but here i get an error relating to the following script command in lib/nova_plugins/hypervisor-docker

sudo cp -p ${DOCKER_DIR}/nova-driver/docker.filters $NOVA_CONF_DIR/rootwrap.d

The error mesage relates to the fact that the file being copied cannot be found. It appears that prior to this step, the docker.filters file is already copied so i uncomment this line from the script and perform a clean re-install (it's a VM so i restore the snapshot prior to running, fix up this script file and run again. Now i get an error much later in the install script:

+ docker run -d -p 5042:5000 -e SETTINGS_FLAVOR=openstack -e OS_USERNAME=admin -e OS_PASSWORD=66360be5db2fe5d579c1 -e OS_TENANT_NAME=admin -e OS_GLANCE_URL= -e OS_AUTH_URL= docker-registry ./docker-registry/
2013/11/04 19:01:29 dial unix /var/run/docker.sock: permission denied
+ echo 'Waiting for docker registry to start...'
Waiting for docker registry to start...
+ timeout 60 sh -c 'while ! curl -s; do sleep 1; done'
+ die 107 'docker-registry did not start'
+ local exitcode=0
+ set +o xtrace
[Call Trace]
[ERROR] /home/openstack/devstack/lib/nova_plugins/hypervisor-docker:107 docker-registry did not start

This i'm assuming is because docker is running using a unix socket, and the script isn't run as the root user.

So my question, has anyone had any success getting Docker to run as the openstack (devstack) hypervisor, if so can you check your git log to see what the commit hash was when it was working and i can try and checkout this specific commit point and try again.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-11-23 06:05:10 -0500

mig.hg gravatar image

The issue with docker registry not starting is due to socket ownership reverting to root. The script changes the docker socket to be writable by your primary group, but I noticed this reverts back to root whenever docker daemon is restarted.

A quick workaround is to run: sudo chgrp $(groups |cut -d' ' -f1) /var/run/docker.sock before running

edit flag offensive delete link more

answered 2013-11-11 23:21:32 -0500

DennyZhang gravatar image

I haven't tried Docker before. But for further investigation, I would suggest you to manually run related commands in hypervisor-docker, which would be like: docker run -d -p ...

Then see what it complains.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-11-04 18:52:14 -0500

Seen: 857 times

Last updated: Nov 23 '13