docker ps # Only running containers
docker ps -a # All containers
docker build -t my-image:tag .
How to run a container with a specific port mapping?
Maps host port 8080 → container port 80.
Use Docker networks:
EXPOSE: Metadata, tells which port the container listens on.
-p: Maps host port to container port (actual access).
Gives JSON with IP, volumes, networks, etc.
Shows image layers and size.
Use Alpine base images.
Multi-stage builds.
Minimize RUN commands and clean caches (apt-get clean, etc.).
Use tagged images:
Sign up to our newsletter to receive our latest news and products. Stay updated on the latest developments and special