seshukm | 64c6aeb | 2017-11-06 12:27:25 +0530 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. http://creativecommons.org/licenses/by/4.0 |
| 3 | .. Copyright 2017 Huawei Technologies Co., Ltd. |
| 4 | |
| 5 | Working with SO Docker |
| 6 | ====================== |
| 7 | |
| 8 | Verify that docker images are built |
| 9 | ------------------------------------ |
| 10 | |
| 11 | .. code-block:: bash |
| 12 | |
| 13 | docker images openecomp/mso |
| 14 | |
| 15 | *Example Output:* |
| 16 | |
| 17 | REPOSITORY TAG IMAGE ID CREATED SIZE |
| 18 | |
| 19 | openecomp/mso 1.1-SNAPSHOT-latest 419e9d8a17e8 3 minutes ago 1.62GB |
| 20 | |
| 21 | openecomp/mso 1.1.0-SNAPSHOT-STAGING-20170926T2015 419e9d8a17e8 3 minutes ago 1.62GB |
| 22 | |
| 23 | openecomp/mso latest 419e9d8a17e8 3 minutes ago 1.62GB |
| 24 | |
| 25 | Start the mariadb container |
| 26 | ---------------------------- |
| 27 | |
| 28 | .. code-block:: bash |
| 29 | |
| 30 | cd $HOME/onap/workspace/SO/docker-config |
| 31 | |
| 32 | MTU=1500 docker-compose up mariadb |
| 33 | |
| 34 | *Example Output:* |
| 35 | |
| 36 | .. code-block:: bash |
| 37 | |
| 38 | . . . many lines omitted . . . |
| 39 | mariadb_1 | Version: '10.1.11-MariaDB-1~jessie-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution |
| 40 | |
| 41 | Log into the mariadb container and run the mysql client program |
| 42 | --------------------------------------------------------------- |
| 43 | |
| 44 | .. code-block:: bash |
| 45 | |
| 46 | docker exec -it dockerconfig_mariadb_1 /bin/bash |
| 47 | mysql -uroot -ppassword |
| 48 | |
| 49 | Start the mso container |
| 50 | ----------------------- |
| 51 | |
| 52 | .. code-block:: bash |
| 53 | |
| 54 | cd $HOME/onap/workspace/SO/docker-config |
| 55 | |
| 56 | MTU=1500 docker-compose up mso |
| 57 | |
| 58 | *Example Output:* |
| 59 | |
| 60 | .. code-block:: bash |
| 61 | |
| 62 | . . . many lines omitted . . . |
| 63 | mso_1 | 20:59:31,586 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final |
| 64 | (WildFly Core 2.2.0.Final) started in 59937ms - Started 2422 of 2747 services (604 services are lazy, passive or |
| 65 | on-demand) |
| 66 | |
| 67 | Log into the mso container |
| 68 | -------------------------- |
| 69 | |
| 70 | .. code-block:: bash |
| 71 | |
| 72 | docker exec -it dockerconfig_mso_1 /bin/bash |
| 73 | |
| 74 | Inspect a docker image |
| 75 | ---------------------- |
| 76 | |
| 77 | This command shows interesting information about the structure of the mso image. Note that an image is NOT a running container. It is the template that a container is created from. |
| 78 | |
| 79 | .. code-block:: bash |
| 80 | |
| 81 | docker inspect openecomp/mso |
| 82 | Example Output: |
| 83 | |
| 84 | [ |
| 85 | { |
| 86 | "Id": "sha256:419e9d8a17e8d7e876dfc36c1f3ed946bccbb29aa6faa6cd8e32fbc77c0ef6e5", |
| 87 | "RepoTags": [ |
| 88 | "openecomp/mso:1.1-SNAPSHOT-latest", |
| 89 | "openecomp/mso:1.1.0-SNAPSHOT-STAGING-20170926T2015", |
| 90 | "openecomp/mso:latest" |
| 91 | ], |
| 92 | "RepoDigests": [], |
| 93 | "Parent": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693", |
| 94 | "Comment": "", |
| 95 | "Created": "2017-09-26T20:40:10.179358574Z", |
| 96 | "Container": "284aa05909390a3c0ffc1ec6d0f6e2071799d56b08369707505897bc73d2ea30", |
| 97 | "ContainerConfig": { |
| 98 | "Hostname": "6397aa10f0c4", |
| 99 | "Domainname": "", |
| 100 | "User": "root", |
| 101 | "AttachStdin": false, |
| 102 | "AttachStdout": false, |
| 103 | "AttachStderr": false, |
| 104 | "ExposedPorts": { |
| 105 | "8080/tcp": {} |
| 106 | }, |
| 107 | "Tty": false, |
| 108 | "OpenStdin": false, |
| 109 | "StdinOnce": false, |
| 110 | "Env": [ |
| 111 | "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", |
| 112 | "HTTP_PROXY=", |
| 113 | "HTTPS_PROXY=", |
| 114 | "http_proxy=", |
| 115 | "https_proxy=", |
| 116 | "JBOSS_HOME=/opt/jboss", |
| 117 | "CHEF_REPO_NAME=chef-repo", |
| 118 | "CHEF_CONFIG_NAME=mso-config" |
| 119 | ], |
| 120 | "Cmd": [ |
| 121 | "/bin/sh", |
| 122 | "-c", |
| 123 | "#(nop) ", |
| 124 | "CMD [\"/opt/mso/scripts/start-jboss-server.sh\"]" |
| 125 | ], |
| 126 | "ArgsEscaped": true, |
| 127 | "Image": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693", |
| 128 | "Volumes": { |
| 129 | "/shared": {} |
| 130 | }, |
| 131 | "WorkingDir": "", |
| 132 | "Entrypoint": null, |
| 133 | "OnBuild": [], |
| 134 | "Labels": { |
| 135 | "Description": "This image contains the ONAP SO", |
| 136 | "Version": "1.0" |
| 137 | } |
| 138 | }, |
| 139 | "DockerVersion": "17.05.0-ce", |
| 140 | "Author": "\"The ONAP Team\"", |
| 141 | "Config": { |
| 142 | "Hostname": "6397aa10f0c4", |
| 143 | "Domainname": "", |
| 144 | "User": "root", |
| 145 | "AttachStdin": false, |
| 146 | "AttachStdout": false, |
| 147 | "AttachStderr": false, |
| 148 | "ExposedPorts": { |
| 149 | "8080/tcp": {} |
| 150 | }, |
| 151 | "Tty": false, |
| 152 | "OpenStdin": false, |
| 153 | "StdinOnce": false, |
| 154 | "Env": [ |
| 155 | "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", |
| 156 | "HTTP_PROXY=", |
| 157 | "HTTPS_PROXY=", |
| 158 | "http_proxy=", |
| 159 | "https_proxy=", |
| 160 | "JBOSS_HOME=/opt/jboss", |
| 161 | "CHEF_REPO_NAME=chef-repo", |
| 162 | "CHEF_CONFIG_NAME=mso-config" |
| 163 | ], |
| 164 | "Cmd": [ |
| 165 | "/opt/mso/scripts/start-jboss-server.sh" |
| 166 | ], |
| 167 | "ArgsEscaped": true, |
| 168 | "Image": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693", |
| 169 | "Volumes": { |
| 170 | "/shared": {} |
| 171 | }, |
| 172 | "WorkingDir": "", |
| 173 | "Entrypoint": null, |
| 174 | "OnBuild": [], |
| 175 | "Labels": { |
| 176 | "Description": "This image contains the ONAP SO", |
| 177 | "Version": "1.0" |
| 178 | } |
| 179 | }, |
| 180 | "Architecture": "amd64", |
| 181 | "Os": "linux", |
| 182 | "Size": 1616881263, |
| 183 | "VirtualSize": 1616881263, |
| 184 | "GraphDriver": { |
| 185 | "Data": null, |
| 186 | "Name": "aufs" |
| 187 | }, |
| 188 | "RootFS": { |
| 189 | "Type": "layers", |
| 190 | "Layers": [ |
| 191 | "sha256:a2022691bf950a72f9d2d84d557183cb9eee07c065a76485f1695784855c5193", |
| 192 | "sha256:ae620432889d2553535199dbdd8ba5a264ce85fcdcd5a430974d81fc27c02b45", |
| 193 | . . . many lines omitted . . . |
| 194 | "sha256:0f9e9dacce9191617e979f05e32ee782b1632e07130fd7fee19b0b2d635aa006", |
| 195 | "sha256:84572c6389f8ae41150e14a8f1a28a70720de91ab1032f8755b5449dc04449c9" |
| 196 | ] |
| 197 | } |
| 198 | } |
| 199 | ] |
| 200 | |
| 201 | Log into the mso image |
| 202 | ----------------------- |
| 203 | |
| 204 | This command allows you to inspect the files inside the mso image. Note that an image is NOT a running container. It is the template that a container is created from. |
| 205 | |
| 206 | .. code-block:: bash |
| 207 | |
| 208 | docker run -it --entrypoint=/bin/bash openecomp/mso -i |