Pull the NGINX Docker image:
docker pull nginx:latest
Generate a stub image with a workload tag called unit_test:
rfstub nginx:latest -t unit_test
Test your stub image. For the purposes of this tutorial, you can simply start a new container and then stop the container:
docker run --rm -it --cap-add=SYS_PTRACE -p9999:80 nginx:latest-rfstub
Generate another stub image with a workload tag called coverage_test:
rfstub nginx:latest -t coverage_test
If a stub image with the same name and tag already exists, RapidFort will automatically generate a new tag for the previous stub image and retag it.
Test your stub image. For the purposes of this tutorial, you can simply start a new container and then stop the container:
docker run --rm -it --cap-add=SYS_PTRACE -p9999:80 nginx:latest-rfstub
Generate another stub image, this time without specifying a workload tag:
rfstub nginx:latest
Harden the new stub image using the unit_test and coverage_test workload tags:
rfharden nginx:latest-rfstub -t unit_test -t coverage_test
Note that no testing was required to harden the new stub image. Instead, the image was hardened using the profiles from unit_test and coverage_test.