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 <omer.anson@toganetworks.com>
Change-Id: Iefd88738424906e832564b23f69320b775c98376
Partially-Implements: blueprint add-dragonflow-api
This commit is contained in:
Shachar Snapiri 2018-11-11 17:38:49 +02:00 committed by Shachar Snapiri
parent f152be2edd
commit 94bb542246
1 changed files with 23 additions and 0 deletions

23
Dockerfile.fedora Normal file
View File

@ -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"]