Skip to content

Instantly share code, notes, and snippets.

@binario200
Created February 11, 2018 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binario200/2d28f126d640e71a6bc5272b204c0138 to your computer and use it in GitHub Desktop.
Save binario200/2d28f126d640e71a6bc5272b204c0138 to your computer and use it in GitHub Desktop.
how to use side car pattern to get process information from a container

in order to get container/application process information liking a topz container to an running container application example:

the container application:

docker run -d --name kuard --publish 8080:8080 gcr.io/kuar-demo/kuard-amd64:1
curl http://localhost:8080  ## will application information
## getting the container id to attach it the topz container

the side car topz container

 docker run --pid=container:$${APP_ID} \
    -p 5000:5000 \
    brendanburns/topz:db0fa58 \
    /server --addr=0.0.0.0:5000  
Serving on 0.0.0.0:5000

# inspecting the topz container that exposes the process application information
curl http://localhost:5000/topz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment