socketplane / docker-ovs

Open vSwitch for Docker
Apache License 2.0
155 stars 42 forks source link

Running docker-ovs the container in interactive console. #12

Closed AJNOURI closed 9 years ago

AJNOURI commented 9 years ago

For testing purposes, I need to run openvswitch utilities from the interactive console

docker run -it socketplane/openvswitch

The console open but doesn't return the prompt, looks like other processe (ovsdb-server) is running in the foreground. I have tried to add "&" at the end of :

[program:ovsdb-server-vtep]
command=/usr/local/sbin/ovsdb-server /etc/openvswitch/conf.db /etc/openvswitch/vtep.db --remote=punix:/var/run/openvswitch/db.sock --pidfile=ovsdb-server.pid 

Still cannot get the console prompt. Any help in that direction?

dave-tucker commented 9 years ago

Hi @AJNOURI, please see the Using the Open vSwitch utilities section of the readme as that may help.

If you want an interactive console, you can do the following:

cid=$(docker run -itd socketplane/openvswitch)
docker exec -it $cid /bin/sh

This has the benefit of starting the Open vSwitch services for you.

It's also possible to docker run -it socketplane/openvswitch /bin/sh but you will have to start ovsdb-server, ovs-vswitchd and run the config script manually (this is all handled by supervisord in the above example)

AJNOURI commented 9 years ago

Thanks @dave-tucker,

cid=$(docker run -itd socketplane/openvswitch)
docker exec -it $cid /bin/sh

suits me.