This project uses Docker to create containers designed to crash from the implementation of a fork bomb.
Python scripting handles creation of images and containers for the respective language and measures the time it takes for a fork bomb script to crash the container.
- python3
- Docker
- Modify the
run.py
script at project root to point to your own python3 interpreter. - From project root:
./run.py <language> <mem_limit> <cpu_limit>
- Only the
<language>
argument is required. - Optional:
<mem_limit>
- Examples:
100m
(100 MB) |2g
(2 GB)
- Examples:
- Optional:
<cpu_limit>
- Examples:
1
(1 CPU Core) |3
(3 CPU Cores)
- Examples:
- Only the
This is handy for troubleshooting errors with execution of the copied code
docker run -it --entrypoint="bash" <image_name>
docker build -t <image_name> -f Dockerfile .
This is handy for confirming that the docker container failed as a result of the code itself and not something else such as a failure to execute.
Uncomment the remove_container(container_id)
line in run.py
to keep the container alive after testing so that the container's id can be used to check the logs.
docker logs <container_id>