We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Live Shell

Being able to run one-off commands is nice, but it's often more convenient to start a shell session running within the container itself. Thats where the -i and -t flags come in:

  • -i makes the exec command interactive
  • -t gives us a tty (keyboard) interface
  • Running /bin/sh gives us a shell session inside the container

For example:

docker exec -it CONTAINER_ID /bin/sh

Assignment

  1. echo "I hacked you!" > index.html
    

Run and submit the CLI tests.