Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run, including libraries, system tools, code, and runtime. By using Docker, you can quickly deploy and scale applications into any environment and know your code will run. Running Docker on AWS provides developers and administrators a highly reliable, low-cost way to build, ship, and run distributed applications at any scale.
Docker collaborates with AWS to help developers quickly bring modern applications to the cloud. This collaboration helps developers use Docker Compose and Docker Desktop to leverage the same local workflow they use today to seamlessly deploy applications on Amazon ECS and AWS Fargate.
Docker works by providing a standard way to run your code. Docker is an operating system for containers. Similar to how a virtual machine virtualizes (removes the need to directly manage) server hardware, containers virtualize the server operating system. Docker is installed on each server and provides simple commands you can use to build, start, or stop containers.
AWS services like AWS Fargate, Amazon ECS, Amazon EKS, and AWS Batch make it easy to run Docker containers at scale.

In this lab, we execute basic Docker commands with AWS VSCode
docker --version

docker pull [OPTIONS] NAME[:TAG|@DIGEST]
docker pull nginx\:latest

docker images [OPTIONS] [REPOSITORY[:TAG]]
docker images

docker run -d -p 8081:80 --name nginx nginx\:latest
-d: Run the container in the background (detached mode)
Name the container nginx
-p 8081:80: Expose port 80 of the container to port 8081 of the host machine
nginx:latest: The container is launched from the image nginx:latest
Reference command to run a container:
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

docker ps
docker ps [OPTIONS]

curl http://localhost:8081
curl [options/URLs]
Additionally, you can read more about CURL

docker logs nginx
docker logs [OPTIONS] CONTAINER

docker exec -it nginx /bin/bash
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

cd /usr/share/nginx/html
cat index.html


docker stop nginx
docker stop [OPTIONS] CONTAINER [CONTAINER...]

docker ps -a to view containers (including stopped containers). To restart, use the command: docker start nginxdocker ps -a

docker rm nginx
docker rm [OPTIONS] CONTAINER [CONTAINER...]

docker rmi nginx\:latest
docker rmi [OPTIONS] IMAGE [IMAGE...]
