Skip to content

A fork of the Debug-Container Project from Daniel Meixner. It is based on NodeJS and provides some calls for debugging and for calling other containers. I extended the project with Error-Codes, Sleep-Time, Header-Copy, SSH Server, ...

Notifications You must be signed in to change notification settings

tzuehlke/DebugContainer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork of: https://github.com/DanielMeixner/DebugContainer Blogpost about this Version: https://www.thomas-zuehlke.de/2019/08/debug-container-for-simple-tests-analyzing/ Image on Docker-Hub: https://hub.docker.com/r/tzuehlke/dbgc

Parameters:

  • COLOR: sets background color for call /. Example: green
  • ERRORRATE: sets the number of calls who fails with the configured error-code. Was used in the calls / and /ping, not at the call /api/whoareu. The /api/cascade call will return the response code from the defined called, therefore if the cascade call return 404 the defined cascade call returns 404. Example: 8
  • ERRORCODE: the response code that should be returned each ERRORRATE call. Example: 404
  • CASCADECONFIG: the JSON configuration of the calls. If multiple configuration are applied, the called service will be randomly selected. Example: [{"ip":"172.17.0.2","port":"80","path":"/"},{"ip":"172.17.0.3", "port":"80", "path":"/ping"}]

Calls:

  • /: shows some debug info and the statuscode
  • /ping: responds with pong and statusocde
  • /api/whoareyou: responses with the color and the IP
  • /api/cascade --> calls one of the given services in the CASCADECONFIG

Setup an Environment:

docker run -p 8083:80 -e COLOR=red -e ERRORRATE=4 -e ERRORCODE=405 tzuehlke/dbgc
docker run -p 8082:80 -e COLOR=tomato -e ERRORRATE=8 -e ERRORCODE=404 tzuehlke/dbgc
docker run -p 8081:80 -e COLOR=yellow -e CASCADECONFIG='[{"ip":"172.17.0.2","port":"80","path":"/"},{"ip":"172.17.0.3", "port":"80", "path":"/ping"}]' tzuehlke/dbgc
docker run -p 8080:80 -e COLOR=green -e CASCADECONFIG='[{"ip":"172.17.0.4","port":"80","path":"/api/cascade"}]' tzuehlke/dbgc

that looks like this: DebugContainer-Overview

About

A fork of the Debug-Container Project from Daniel Meixner. It is based on NodeJS and provides some calls for debugging and for calling other containers. I extended the project with Error-Codes, Sleep-Time, Header-Copy, SSH Server, ...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.6%
  • Dockerfile 11.9%
  • Shell 1.5%