Learn how to use the docker exec command to run commands and get an interactive shell in a Docker container. Find out how to start a test container, run a command inside a container, set the working directory, run a command as a different user, and pass environment variables into a container.
Table of contents
PrerequisitesStarting a Test ContainerFinding the Name of a Docker ContainerRunning an Interactive Shell in a Docker ContainerRunning a Non-interactive Command in a Docker ContainerRunning Commands in an Alternate Directory in a Docker ContainerRunning Commands as a Different User in a Docker ContainerPassing Environment Variables into a Docker ContainerCommon ErrorsConclusionSort: