📜  Dockers Basics
Docker is a containerization platform that simplifies the process of developing, deploying, and running applications. It allows developers to package their applications and all their dependencies into a standardized unit called a container. These containers are isolated from each other and from the underlying infrastructure, making them portable and consistent across different environments. Docker uses container technology to virtualize the operating system, enabling applications to run in a lightweight and efficient manner.
One of Docker's key benefits is its ability to streamline the development and deployment workflows. Developers can create containers that include everything their application needs to run, such as libraries, dependencies, and configuration settings. These containers can then be easily shared with team members or deployed to production environments, ensuring consistency and reducing compatibility issues. Docker also provides tools for managing and orchestrating containers at scale, making it a popular choice for building and deploying modern, cloud-native applications.
📜  Here is a typical Docker File


        FROM node:21.6.2 AS build
        WORKDIR /app
        COPY package.json .
        COPY package-lock.json ./
        RUN npm install 
        COPY . ./
        RUN npm run build 
        EXPOSE 3000
        CMD ["node", "./build/index.js"]


📜  Docker Build Command

The dot at the end is important.

sudo docker build -t docker_username/image_name:tag .
📜  Docker Push

sudo docker push docker_username/image_name:tag

📜  Docker Pull

sudo docker pull docker_username/image_name:tag

📜  Docker Pull

sudo docker run -d -p 8080:80 --name container_name image_name:tag