Docker exec #
Run a command within a container.
Interactive #
Run a command in an interactive mode within a specified container.
docker exec -it <container name or id> <command>
With something like the lightweight Alpine Linux distro, the command might be something like /bin/sh
, which kicks off a lightweight terminal from within the container.
^ Once the above command is run for instance, pretty much anything that can be done at the command line can be performed, including navigating around with old reliable cd
.
Get get out of the container’s command line, run exit
.