Complete the command to run tests inside a Docker container.
docker run --rm [1] myapp:test--rm twice causes an error.-d runs container in background, hiding test output.The -it option allows interactive terminal access, which is useful for running tests inside the container.
Complete the command to mount the current directory inside the container for testing.
docker run --rm -v [1]:/app myapp:test$(pwd) dynamically gets the current directory path to mount inside the container.
Fix the error in the command to run tests with environment variables.
docker run --rm -e [1] myapp:test-e option is invalid.The -e option requires KEY=VALUE format for environment variables.
Fill both blanks to run tests in detached mode and name the container.
docker run [1] [2] myapp:test
-it with detached mode causes conflicts.-d runs the container in detached mode, and --name assigns a custom container name.
Fill all three blanks to build an image, tag it, and run tests inside the container.
docker build -t [1] . && docker run --rm -v [2]:/app [3] myapp:test
First, build the image with tag myapp:test. Then mount current directory $(pwd) inside container and run it interactively with -it to see test output.