In your key folder on host machine where you created the Dockerfile above, you should have a bunch of private keys, public keys, certificate signing request, etc. Only localhost.key and localhost.crt are of interests to us, the rest were created to eventually get the self-signed certificate localhost.crt.
Copy localhost.key into the key field in the imposters.ejs file, and localhost.crt into cert.
in host terminal build the image and tag it as generate_key
docker build -t generate_key --rm .
spin up a container based on the image
docker run --rm -v $PWD/key:/home/ubuntu/key -it --entrypoint /bin/bash generate_key
run the following command in the container CLI
In your key folder on host machine where you created the Dockerfile above, you should have a bunch of private keys, public keys, certificate signing request, etc. Only localhost.key and localhost.crt are of interests to us, the rest were created to eventually get the self-signed certificate localhost.crt.
Copy localhost.key into the key field in the imposters.ejs file, and localhost.crt into cert.