Last active
May 8, 2018 16:25
-
-
Save filipeandre/a0b5851e2864b0c98bdf699785a0be0e to your computer and use it in GitHub Desktop.
Docker commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copy files from host to container and vice versa | |
| docker cp src/. $container:/target | |
| docker cp $container:/src/. target | |
| # Exec an command on a running container | |
| docker exec -it $container $command | |
| # List all containers running or not | |
| docker ps -a | |
| # Container start, stop and restart | |
| docker start $container | |
| docker stop $container | |
| docker restart $container | |
| # Docker compose up deamon and simple | |
| docker-compose up -d | |
| docker-compose up | |
| docker-compose down | |
| # Check the config of a container or network | |
| docker inspect $container | |
| docker network inspect $network | |
| # List all images | |
| docker images | |
| # Attach to a running container without leaving on ctrl-c | |
| docker attach --sig-proxy=false $container |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment