diff --git a/doc/source/docker_install.rst b/doc/source/docker_install.rst index f043bc0f5..0f04ae189 100644 --- a/doc/source/docker_install.rst +++ b/doc/source/docker_install.rst @@ -109,3 +109,17 @@ This will start the container with the Dragonflow installed, but no service. This is useful in order to test any standalone binaries or code that should use the Dragonflow as a library, separated from the controller node. + +Using the container as a base for other container +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The docker entrypoint script accepts verbs. To only run the configuration and +use the container with another main process, in your entrypoint run the +following command: + +.. code-block:: bash + + /opt/dragonflow/tools/run_dragonflow.sh --dragonflow_ip --db_ip :2379 noop + +Note that running a container with the noop verb without a live process as +entrypoint will cause the container to exit immediately. diff --git a/tools/run_dragonflow.sh b/tools/run_dragonflow.sh index d2666a736..139963197 100755 --- a/tools/run_dragonflow.sh +++ b/tools/run_dragonflow.sh @@ -86,4 +86,10 @@ case "$VERB" in pip install bottle /usr/local/bin/df-rest-service --config /etc/dragonflow/dragonflow.ini --host 0.0.0.0 --json /var/dragonflow_model.json ;; + "noop") + echo "Dragonflow script end" + ;; + *) + echo>&2 "Warning: Unknown option supplied to Dragonflow: $VERB" + ;; esac