Docker commands

Instead of the name of the container you can usually just enter the first 2 to 3 characters of the container id, which you can get using docker ps. It depends on how many characters are required for identifying the beginning of the container id unambigously.

  • List running containers:

    docker ps

  • Stop running container “properly”

    docker stop <CONTAINER-NAME>

  • Kill running container:

    docker kill <CONTAINER-NAME>

  • Copy files out of a running container

    docker cp <CONTAINER-NAME>:<PFAD-UND-DATEI> <ZIEL>

  • Copy files into a running container:

    docker cp <ZIEL> <CONTAINER-NAME>:<PFAD-UND-DATEI>