mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
add docker-compose's cheatsheet
This commit is contained in:
parent
fe2fc173bf
commit
a74f5c4939
2 changed files with 26 additions and 0 deletions
20
cheats/docker-compose.cheat
Normal file
20
cheats/docker-compose.cheat
Normal file
|
@ -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 <service_name>
|
||||
|
||||
# Builds, (re)creates, starts, and dettaches to containers for a service
|
||||
docker-compose up -d <service_name>
|
||||
|
||||
# Print the last lines of a service’s logs
|
||||
docker-compose logs --tail 100 <service_name> | less
|
||||
|
||||
# Print the last lines of a service's logs and following its logs
|
||||
docker-compose logs -f --tail 100 <service_name>
|
||||
|
||||
# Stops containers and removes containers, networks created by up
|
||||
docker-compose down
|
|
@ -36,5 +36,11 @@ docker exec -it <container_id> bash
|
|||
# Print the last lines of a container’s logs
|
||||
docker logs --tail 100 <container_id> | less
|
||||
|
||||
# Print the last lines of a container's logs and following its logs
|
||||
docker logs --tail 100 <container_id> -f
|
||||
|
||||
# Create new network
|
||||
docker network create <network_name>
|
||||
|
||||
$ image_id: docker images --- --headers 1 --column 3
|
||||
$ container_id: docker ps --- --headers 1 --column 1
|
Loading…
Reference in a new issue