This repository contains Dockerfile for Docker's automated build published to the public Docker Hub Registry.
-
Install Docker
-
Download automated build from public Docker Hub Registry:
docker pull czerasz/http-debugger
Alternatively, you can build an image from
Dockerfile
:docker build --tag czerasz/http-debugger github.com/czerasz/docker-http-debugger
Start the container:
docker run -t --rm -p 3000:3000 czerasz/http-debugger
Test the application with curl
:
$ curl -i -XPOST localhost:3000/test -d 'test=true'
HTTP/1.1 200 OK
X-Powered-By: Express
X-Debug: true
Content-Type: text/html; charset=utf-8
Content-Length: 2
ETag: W/"2-79dcdd47"
Date: Wed, 13 May 2015 16:25:37 GMT
Connection: keep-alive
ok
Now go back to the terminal where the container runs. You will see the request details:
> debugging_application@1.0.0 start /usr/local/bin/app
> node index.js
Debugging app listening at http://:::3000
--- --- --- --- --- --- --- --- --- --- --- --- ---
[2015-05-13 16:25:37] Request 1
POST/1.1 /test on :::3000
Headers:
- user-agent: curl/7.38.0
- host: localhost:3000
- accept: */*
- content-length: 9
- content-type: application/x-www-form-urlencoded
No cookies
Body:
test=true
Make sure the directory exists:
SOCKET_DIRECTORY=/var/app/app_name/shared/tmp/sockets/
mkdir -p $SOCKET_DIRECTORY
Run the container:
docker run -t --rm \
-v $SOCKET_DIRECTORY:$SOCKET_DIRECTORY \
-e LISTEN_SOCKET="${SOCKET_DIRECTORY}app_name.0.sock" \
czerasz/http-debugger