• Uncategorized

About linux : Open-vSwitch-not-working-on-Docker

Question Detail

I’m using ubuntu 14.04 and Docker version:

Client:
 Version:       17.12.1-ce
 API version:   1.35
 Go version:    go1.9.4
 Git commit:    7390fc6
 Built: Tue Feb 27 22:17:56 2018
 OS/Arch:       linux/amd64
Server:
 Engine:
  Version:      17.12.1-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   7390fc6
  Built:        Tue Feb 27 22:16:28 2018
  OS/Arch:      linux/amd64
  Experimental: false

Below is my Dockerfile:

FROM ubuntu:16.04
# Install the required packages
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install openvswitch-switch openvswitch-common
RUN apt-get -y install nano
RUN apt-get -y install iproute2
RUN apt-get -y install tcpdump
RUN apt-get -y install openssh-server
RUN apt-get -y install net-tools
RUN apt-get -y install iputils-ping
RUN rm -rf /var/lib/apt/lists/*

After that I’m doing:

$sudo docker build -t mhkabir/ovs-container:latest .
$sudo docker run -it mhkabir/ovs-container:latest bash

Inside container, when I try to check Open vSwitch it’s showing the error:

[email protected]:/# ovs-vsctl show
ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)

Expecting your suggestions. thank you.

Question Answer

this is issue might be related to the directory /var/run/openvswitch/ is missing, causing the ovs-ctl daemon to fail on startup , there is two potential workarounds :

1-create the directory /var/run/openvswitch/ like RUN mkdir /var/run/openvswitch/ in your docker file

2-manually execute the /usr/share/openvswitch/scripts/ovs-ctl start command

Both ovs-vswitchd and ovsdb-server are running ?

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.