Skip to content

Instantly share code, notes, and snippets.

@verticalgrain
Last active May 27, 2019 17:04
Show Gist options
  • Save verticalgrain/31e91c709c57f65c3797e95af17764d4 to your computer and use it in GitHub Desktop.
Save verticalgrain/31e91c709c57f65c3797e95af17764d4 to your computer and use it in GitHub Desktop.

Revisions

  1. verticalgrain revised this gist May 27, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Docker Gist
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,10 @@ docker system prune -a
    docker ps -aq.

    // Stop all running containers.
    docker stop $(docker ps -aq)
    docker stop $(docker ps -a -q)

    // Remove all containers.
    docker rm $(docker ps -aq)
    docker rm $(docker ps -a -q)

    // Remove all images.
    docker rmi $(docker images -q)
  2. verticalgrain revised this gist May 1, 2019. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion Docker Gist
    Original file line number Diff line number Diff line change
    @@ -31,4 +31,10 @@ docker cp foo.txt mycontainer:/foo.txt
    docker cp mycontainer:/foo.txt foo.txt

    docker cp src/. mycontainer:/target
    docker cp mycontainer:/src/. target
    docker cp mycontainer:/src/. target

    // List running containers
    docker container ls

    // Check container status
    docker-compose ps
  3. verticalgrain revised this gist Oct 25, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Docker Gist
    Original file line number Diff line number Diff line change
    @@ -18,13 +18,14 @@ docker rmi $(docker images -q)
    docker container start containername

    // SSH Into container
    docker exec -it containername /bin/bash
    docker exec -it containername /bin/bash


    // Start docker machine
    eval $(docker-machine env default)
    docker-machine ls

    //
    // Copy to and from docker machine
    docker cp foo.txt mycontainer:/foo.txt
    docker cp mycontainer:/foo.txt foo.txt
  4. verticalgrain revised this gist Oct 25, 2018. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion Docker Gist
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,11 @@ docker container start containername

    // Start docker machine
    eval $(docker-machine env default)
    docker-machine ls
    docker-machine ls

    // Copy to and from docker machine
    docker cp foo.txt mycontainer:/foo.txt
    docker cp mycontainer:/foo.txt foo.txt

    docker cp src/. mycontainer:/target
    docker cp mycontainer:/src/. target
  5. verticalgrain revised this gist Oct 25, 2018. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion Docker Gist
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,9 @@ docker rmi $(docker images -q)
    docker container start containername

    // SSH Into container
    docker exec -it containername /bin/bash
    docker exec -it containername /bin/bash


    // Start docker machine
    eval $(docker-machine env default)
    docker-machine ls
  6. verticalgrain revised this gist Oct 25, 2018. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion Docker Gist
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,10 @@ docker stop $(docker ps -aq)
    docker rm $(docker ps -aq)

    // Remove all images.
    docker rmi $(docker images -q)
    docker rmi $(docker images -q)

    // Start container
    docker container start containername

    // SSH Into container
    docker exec -it containername /bin/bash
  7. verticalgrain revised this gist Oct 18, 2018. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion Docker Gist
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,15 @@

    // clean cache and do some ot her scary stuff
    docker system prune -a
    docker system prune -a

    // List all containers (only IDs)
    docker ps -aq.

    // Stop all running containers.
    docker stop $(docker ps -aq)

    // Remove all containers.
    docker rm $(docker ps -aq)

    // Remove all images.
    docker rmi $(docker images -q)
  8. verticalgrain created this gist Oct 17, 2018.
    3 changes: 3 additions & 0 deletions Docker Gist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@

    // clean cache and do some ot her scary stuff
    docker system prune -a