Docker and Kubernetes

Open a shell inside a running container

Get a terminal inside a Docker container to look around, check files or debug.

Fill these in once
  1. Find the container's name
    Terminal
    docker ps
  2. Open a shell inside it
    Terminal
    docker exec -it my-app sh

    Use bash instead of sh if the image has it. Type exit to leave.

  1. Find the container's name
    Terminal · Ubuntu / Debian
    docker ps
  2. Open a shell inside it
    Terminal · Ubuntu / Debian
    docker exec -it my-app sh

    Use bash instead of sh if the image has it. Type exit to leave.

  1. Find the container's name
    PowerShell
    docker ps
  2. Open a shell inside it
    PowerShell
    docker exec -it my-app sh

    Use bash instead of sh if the image has it. Type exit to leave.