diff --git a/cheats/docker-compose.cheat b/cheats/docker-compose.cheat new file mode 100644 index 0000000..4aee3f3 --- /dev/null +++ b/cheats/docker-compose.cheat @@ -0,0 +1,20 @@ +# Builds, (re)creates, starts, and attaches to containers for all services +docker-compose up + +# Builds, (re)creates, starts, and dettaches to containers for all services +docker-compose up -d + +# Builds, (re)creates, starts, and attaches to containers for a service +docker-compose up -d + +# Builds, (re)creates, starts, and dettaches to containers for a service +docker-compose up -d + +# Print the last lines of a service’s logs +docker-compose logs --tail 100 | less + +# Print the last lines of a service's logs and following its logs +docker-compose logs -f --tail 100 + +# Stops containers and removes containers, networks created by up +docker-compose down \ No newline at end of file diff --git a/cheats/docker.cheat b/cheats/docker.cheat index 098b3a5..66f76b4 100644 --- a/cheats/docker.cheat +++ b/cheats/docker.cheat @@ -36,5 +36,11 @@ docker exec -it bash # Print the last lines of a container’s logs docker logs --tail 100 | less +# Print the last lines of a container's logs and following its logs +docker logs --tail 100 -f + +# Create new network +docker network create + $ image_id: docker images --- --headers 1 --column 3 $ container_id: docker ps --- --headers 1 --column 1 \ No newline at end of file