0%

Docker Command Cheatsheet

  • Docker download and upload files

    1
    docker cp <containerID>:path localpath

  • RM image

    1
    2
    docker images
    docker rmi <REPOSITORY>

  • RM container

    1
    2
    docker ps -a
    docker rm <REPOSITORY>

  • Run a container of an image with port mapping

    1
    docker run -it -p 127.0.0.1:<Port1>:<Port1> -p 127.0.0.1:<Port2>:<Port2> --name <name> <REPOSITORY>

  • Start or stop a container

    1
    2
    docker start -a <NAMES>
    docker stop <NAMES>

  • Commit a runnning container to a image

    1
    2
    docker ps -a
    docker commit <ContainerID> <ImageName>

  • Enter into docker container

    1
    docker exec -it <ContainerID> /bin/bash