docker network create name_of_network
docker pull image_name
docker ps
docker ps -a
docker stop container_id or name
docker start container_id or name
docker run image_name
docker run -d image_name
docker run -d -p<machine_port>:<docker_port> -d --name=name_for_container image_name
docker network ls
docker-compose -f mongo.yaml up
docker build -t name_of_new_image:version path of docker file
ex. docker build -t my_app:1.0.0 ./app
docker rmi image_id
docker rm container_id
docker exec -it container_id /bin/bash
docker exec -it container_id /bin/sh
docker ps -a | grep my-app (to list all the containers of a image)
docker run -d -e MONGO_DB_USERNAME=admin -e MONGO_DB_PWD=password my-app:1.1 (setting env variables at the time of container creation)
docker tag my-app:latest 159425601627.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
docker push 159425601627.dkr.ecr.us-east-1.amazonaws.com/my-app:tag
docker logs [OPTIONS] container_id
--details Show extra details provided to logs
--follow , -f Follow log output
--since Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
--tail , -n all Number of lines to show from the end of the logs
--timestamps , -t Show timestamps
--until Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)