docker install documentation not consistent

Order of commands and usage of ContainerId and ContainerIP should be
consistent and examples need to work.

Change-Id: I7bb7cee608aeef1916ed9d17fa67566943291af9
Closes-bug: 1671067
This commit is contained in:
Tomi Juvonen 2017-03-08 15:42:48 +02:00
parent 0f7ee6d791
commit c18917cdc4
1 changed files with 11 additions and 11 deletions

View File

@ -63,21 +63,21 @@ Run the Craton Docker Image
Calling into Craton
-------------------
* Let's get container Id::
$ ContainerId=$(docker ps | grep craton-api:latest | awk '{print $1}')
* We need the container IP, so we can run an API call against Craton running in the container::
$ ContainerIP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${ContainerId})
* To generate a sample data set, use the following command::
$ python tools/generate_fake_data.py --url http://{Container_IP}:7780/v1 --user demo --project b9f10eca66ac4c279c139d01e65f96b4 --key demo
$ python tools/generate_fake_data.py --url http://${ContainerIP}:8080/v1 --user demo --project b9f10eca66ac4c279c139d01e65f96b4 --key demo
* Now, let's run an API call against Craton running in the container. First, we need to enumerate the running Docker images::
* Now you can run a curl command like the one below to query Craton::
$ sudo docker ps
* Use the container id from that command in this next command to find the container's IP address::
$ sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${ContainerId}
* Now that you know the IP address, you can run a curl command like the one below to query Craton::
$ curl -i "http://{Container_IP}:7780/v1/hosts?region_id=1" -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4"
$ curl -i "http://${ContainerIP}:8080/v1/hosts?region_id=1" -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4"
-------------------