Docker

Docker compose

docker-compose up --build
docker-compose up --remove-orphans -d

Stop all containers

docker stop $(docker ps -aq)

Remove all containers

docker rm $(docker ps -aq)

List images

docker images

See which containers are running

docker ps

See all containers, including non-running

docker ps -a

Delete all images

sudo docker rmi $(sudo docker images -q) --force

Copy a file from container to host

docker cp :/file/path/within/container /host/path/target

View container logs

sudo docker logs my-symf

Run a php script inside a container

docker run --rm -v $(pwd):/app -w /app php:cli php hello.php

Get ip address of container

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' 
sudo docker inspect  | grep IPAddress

Command prompt into a container

sudo docker exec -it  bash
sudo docker exec -it wp-local-docker_phpfpm_1 /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh"
docker-compose exec --user www-data phpfpm bash