Question: I'm attempting to use an API in ReadyAPI but it is not working for me. When I do the request via CURL it works fine. Any help would be appreciated. 

Here is a sample of the format for the request via Curl, the end part is URL encoded:

```
curl -k -X POST https://myHost.test/999299/profile/SAML2/SOAP/https%3A%2F%2FmyHost.test-999299 -H 
"Content-Type: text/xml" -d '{
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        body
    </S:Body>
</S:Envelope>
}' 

```

This returns the proper response that I expect. However when I use this in SoapUI and enter a new REST service from URL it removed the URL encoding and forms a request like this:

```
POST https://myHost.test/999299/profile/SAML2/SOAP/https://myHost.test-999299 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml
Content-Length: 555
Host: myHost.test
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        body
    </S:Body>
</S:Envelope>

```

This request returns a 404 Not Found. Not sure if the URL encoding matters, but when i add it back manually it gives me an internal server error. What am I missing in the soapui Request.

Answer: 
That is what `-it` is supposed to do. It means a interactive bash and it will only exit when you are done with it. Change your code as below

```
docker run -d --name application -p 80:80 -d  tutum/apache-php
docker run -d -p 3306:3306 --name=database --
env="MYSQL_ROOT_PASSWORD=password1" mysql:latest
echo "--------------------------------------------------------------------"
echo "Docker is all done - run docker ps -a to see all created 
containers!"
echo "--------------------------------------------------------------------"
echo "Moving onto installing application into app container!"
echo "--------------------------------------------------------------------"

docker exec application bash -c "apt-get update & apt-get install git -y"
docker exec -it application bash -c "cd /var/www/html; exec bash"

```
A few remarks here: 

It's better to use `docker exec -it application /bin/bash` (providing the path to the bash executable) because in containers usually the $PATH isn't set, so you're probably getting an error.

Also, the command `docker exec -it application /bin/bash` will enter `interactive` mode, which allocates a command line for you, so the script will stop execution there and wait for you to enter some command at `stdin`.

Now, if you want to run a series of commands in a docker container, you can't do it by providing them inside the script.

One thing you can do, is create a script file (eg. `myscript.sh`) that you can mount as a volume to your `docker run` (eg. `docker run -v /Users/Calvin/myscript.sh:/myscript.sh`. Another thing you can do is provide the commands via `-c`, so `docker exec application /bin/sh -C 'apt-get update ....'` (notice I'm not using the `-it` flag).

Finally, the best practice for what you're trying to achieve is provide a `Dockerfile`, so that you run `apt-get update` and `apt-get install -y git` when the container is being built, and not every time you bring it up.

Sample Dockerfile:

```
FROM tutum/apache-php
RUN apt-get update
RUN apt-get install -y git

```

and then use `docker build -t .`

More on Dockerfile here: <https://docs.docker.com/engine/reference/builder/>