# to build an image of the current directories docker file
docker build -t <name> .
docker images
docker run <name>
# run with a user and tag
docker run -i -t -u 0 cp_test:latest
# list running containers
docker ps
# connect to it
docker exec -it <running_cont_id> bash
# or just launch an ubuntu shell directly
docker run -i -t ubuntu /bin/bash
docker inspect <repo:tag or id>
A few clean up commands:
# Remove everything
docker prune
# containers
docker rm $(docker ps -a -q)
# images
docker rmi $(docker images -q)
# get image id
docker images
# delete image
docker rmi -f <image id>
# add -d flag for daemon mode
docker-compose up
docker-compose ps
docker-compose stop