From 94bb5422468a17f9ca9444afc0e16af44143c773 Mon Sep 17 00:00:00 2001 From: Shachar Snapiri Date: Sun, 11 Nov 2018 17:38:49 +0200 Subject: [PATCH] Add Fedora based docker file creation This docker image is using Python 3.6 as default instead of the 2.6 version used by the default image. In order to create the Fedora docker image, use the following command: docker build -t dragonflow -f Dockerfile.fedora . Recently we have added features that are supported only with Python 3, so this docker will allow us to run them natively. e.g. https://review.openstack.org/#/c/616106 Co-Authored-By: Omer Anson Change-Id: Iefd88738424906e832564b23f69320b775c98376 Partially-Implements: blueprint add-dragonflow-api --- Dockerfile.fedora | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile.fedora diff --git a/Dockerfile.fedora b/Dockerfile.fedora new file mode 100644 index 000000000..6966f8f55 --- /dev/null +++ b/Dockerfile.fedora @@ -0,0 +1,23 @@ +FROM fedora:latest + +RUN dnf install -y git python3-pip python3-psutil python3-devel \ + "@C Development Tools and Libraries" + +RUN alternatives --install /usr/bin/python python /usr/bin/python3 1 +RUN alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 + +RUN mkdir -p /opt/dragonflow + +# Copy Dragonflow sources to the container +COPY . /opt/dragonflow/ + +# Install Dragonflow on the container +WORKDIR /opt/dragonflow +RUN pip install -e . + +# Create config folder +ENV DRAGONFLOW_ETCDIR /etc/dragonflow +RUN mkdir -p $DRAGONFLOW_ETCDIR + +ENTRYPOINT ["./tools/run_dragonflow.sh"] +