Show running containers
docker-compose ps
docker-compose ps -a #Full display including stopped container
Start container
docker-compose start (up -d is okay)
Create and start a container
docker-compose up
docker-compose up -d #Run in the background
Stop the running container
docker-compose stop
Build image
docker-compose build
Creating a container
docker-compose create
Destroy the container
docker-compose down
Connect to container
docker-compose exec container name bash
View log
docker-compose logs container name
Find out which environment variables are available in the service
docker-compose run service name env
Destroy the container and destroy the image
docker-compose down --rmi all
Recommended Posts