docker compose build --no-cache
# service name is specified in docker-compose.yml
docker compose run ${compose_service_name} bash
Create the set of containers and run it
# Up
docker compose up
docker compose up -d # runs in background
# If nginx service does not run correctly, try some of them
# 1. Use `--forece-recreate` option
# 1. Change service name in `docker-compose.yml`
docker compose up --force-recreate
http://localhost:8080
# Create
docker run --name ${container_name} -d -p 8080:80 nginx
docker ps
# attach
docker exec -it ${container_id} /bin/bash
# Terminate
docker stop ${container_id}
docker rm ${container_id}
docker container prune # Remove all containers
# Delete image
docker images
docker rmi ${image_name}