diff --git a/docker/centos/binary/openvswitch/ovs-base/Dockerfile b/docker/centos/binary/openvswitch/ovs-base/Dockerfile new file mode 100644 index 0000000000..7d4ade54cd --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-base/Dockerfile @@ -0,0 +1,5 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum install -y openvswitch \ + && yum clean all diff --git a/docker/centos/binary/openvswitch/ovs-base/build b/docker/centos/binary/openvswitch/ovs-base/build new file mode 120000 index 0000000000..0e4aef422e --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-base/build @@ -0,0 +1 @@ +../../../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/openvswitch/ovs-db-server/Dockerfile b/docker/centos/binary/openvswitch/ovs-db-server/Dockerfile new file mode 100644 index 0000000000..5728995b3a --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-db-server/Dockerfile @@ -0,0 +1,7 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%ovs-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +COPY ./start.sh /start.sh + +CMD ["/start.sh"] + diff --git a/docker/centos/binary/openvswitch/ovs-db-server/build b/docker/centos/binary/openvswitch/ovs-db-server/build new file mode 120000 index 0000000000..ec19138031 --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-db-server/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/openvswitch/ovs-db-server/start.sh b/docker/centos/binary/openvswitch/ovs-db-server/start.sh new file mode 120000 index 0000000000..145b2426fc --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-db-server/start.sh @@ -0,0 +1 @@ +../../../../common/openvswitch/ovs-db-server/start.sh \ No newline at end of file diff --git a/docker/centos/binary/openvswitch/ovs-vswitchd/Dockerfile b/docker/centos/binary/openvswitch/ovs-vswitchd/Dockerfile new file mode 100644 index 0000000000..4acdb5d53f --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-vswitchd/Dockerfile @@ -0,0 +1,6 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%ovs-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +COPY ./start.sh /start.sh + +CMD ["/start.sh"] diff --git a/docker/centos/binary/openvswitch/ovs-vswitchd/build b/docker/centos/binary/openvswitch/ovs-vswitchd/build new file mode 120000 index 0000000000..ec19138031 --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-vswitchd/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/openvswitch/ovs-vswitchd/start.sh b/docker/centos/binary/openvswitch/ovs-vswitchd/start.sh new file mode 120000 index 0000000000..c1038c338b --- /dev/null +++ b/docker/centos/binary/openvswitch/ovs-vswitchd/start.sh @@ -0,0 +1 @@ +../../../../common/openvswitch/ovs-vswitchd/start.sh \ No newline at end of file diff --git a/docker/common/openvswitch/ovs-db-server/start.sh b/docker/common/openvswitch/ovs-db-server/start.sh new file mode 100755 index 0000000000..a2b4d6c8fe --- /dev/null +++ b/docker/common/openvswitch/ovs-db-server/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +LOG_FILE="/var/log/openvswitch/ovsdb-server.log" +DB_FILE="/etc/openvswitch/conf.db" +UNIXSOCK_DIR="/var/run/openvswitch" +UNIXSOCK="${UNIXSOCK_DIR}/db.sock" + +mkdir -p "${UNIXSOCK_DIR}" + +if [[ ! -e "${DB_FILE}" ]]; then + ovsdb-tool create "${DB_FILE}" +fi + +exec ovsdb-server $DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:"${UNIXSOCK}" --log-file="${LOG_FILE}" diff --git a/docker/common/openvswitch/ovs-vswitchd/start.sh b/docker/common/openvswitch/ovs-vswitchd/start.sh new file mode 100755 index 0000000000..5ed1fbe755 --- /dev/null +++ b/docker/common/openvswitch/ovs-vswitchd/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +modprobe openvswitch + +LOG_FILE="/var/log/openvswitch/ovs-vswitchd.log" +DB_FILE="/etc/openvswitch/conf.db" +UNIXSOCK_DIR="/var/run/openvswitch" +UNIXSOCK="${UNIXSOCK_DIR}/db.sock" + +mkdir -p "${UNIXSOCK_DIR}" + +exec ovs-vswitchd unix:"${UNIXSOCK}" -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file="${LOG_FILE}"