Move docker documentation into installation
[policy/parent.git] / docs / installation / docker.rst
1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4
5
6 Policy Docker Installation
7 --------------------------
8
9 .. contents::
10     :depth: 2
11
12
13 Building the ONAP Policy Framework Docker Images
14 ************************************************
15 The instructions here are based on the instructions in the file *~/git/onap/policy/docker/README.md*.
16
17 **Step 1:** Build the Policy API Docker image
18
19 .. code-block:: bash
20
21 cd ~/git/onap/policy/api/packages
22 mvn clean install -P docker
23
24 **Step 2:** Build the Policy PAP Docker image
25
26 .. code-block:: bash
27
28 cd ~/git/onap/policy/pap/packages
29 mvn clean install -P docker
30
31 **Step 3:** Build the Drools PDP docker image.
32
33 This image is a standalone vanilla Drools engine, which does not contain any pre-built drools rules or applications.
34
35 .. code-block:: bash
36
37 cd ~/git/onap/policy/drools-pdp/
38 ./docker_verify.sh
39
40 **Step 4:** Build the Drools Application Control Loop image.
41
42 This image has the drools use case application and the supporting software built together with the Drools PDP engine. It is recommended to use this image if you are first working with ONAP Policy and wish to test or learn how the use cases work.
43
44 .. code-block:: bash
45
46 cd ~/git/onap/policy/drools-applications
47 chmod 755 controlloop/build/docker-cl
48 controlloop/build/docker-cl --verify
49
50 **Step 5:** Build the Apex PDP docker image:
51
52 .. code-block:: bash
53
54 cd ~/git/onap/policy/apex-pdp/packages/apex-pdp-docker/target
55 docker build -t onap/policy-apex-pdp policy-apex-pdp
56
57 **Step 5:** Build the XACML PDP docker image:
58
59 .. code-block:: bash
60
61 cd ~/git/onap/policy/xacml-pdp/packages
62 mvn clean install -P docker
63
64 **Step 7:** Build the policy engine docker image (If working with the legacy Policy Architecture/API):
65
66 .. code-block:: bash
67
68 cd ~/git/onap/policy/engine/
69 ./docker_verify.sh
70
71 **Step 8:** Build the Policy SDC Distribution docker image:
72
73 .. code-block:: bash
74
75 cd ~/git/onap/policy/distribution/packages
76 mvn clean install -Pdocker
77
78
79 Starting the ONAP Policy Framework Docker Images
80 ************************************************
81
82 In order to run the containers, you can use *docker-compose*. This uses the *docker-compose.yml* yaml file to bring up the ONAP Policy Framework. This file is located in the policy/docker repository.
83
84 **Step 1:** Set the environment variable *MTU* to be a suitable MTU size for the application.
85
86 .. code-block:: bash
87
88 export MTU=9126
89
90
91 **Step 2:** Determine if you want policies pre-loaded or not. By default, all the configuration and operational policies will be pre-loaded by the docker compose script. If you do not wish for that to happen, then export this variable:
92
93 .. code-block:: bash
94
95 export PRELOAD_POLICIES=false
96
97
98 **Step 3:** Run the system using *docker-compose*. Note that on some systems you may have to run the *docker-compose* command as root or using *sudo*. Note that this command takes a number of minutes to execute on a laptop or desktop computer.
99
100 .. code-block:: bash
101
102 docker-compose up -d
103
104
105 **You now have a full standalone ONAP Policy framework up and running!**
106
107
108
109
110 End of Document
111