-2

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:

root@60cf0a5b5cfd:/# ovs-vsctl show
ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)

Expecting your suggestions. thank you.

nickgryg
  • 25,567
  • 5
  • 77
  • 79
kabir
  • 5
  • 5
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Mar 22 '18 at 03:02
  • Have you checked the log? – pchaigno Mar 22 '18 at 07:49

2 Answers2

1

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

Amir Rasti
  • 706
  • 7
  • 19
-2

Both ovs-vswitchd and ovsdb-server are running ?

takaomag
  • 1,545
  • 1
  • 16
  • 26