This project covers following concepts:
- Basics of Docker
- docker-compose
docker --version
docker build -t <docker_hub_ID>/<custom_image_name> .
docker build -t ishahroz/simple-dockerized-node-app .
docker run <docker_hub_ID>/<custom_image_name>
docker run ishahroz/simple-dockerized-node-app
docker run -p <local_port>:<container_port> <docker_hub_ID>/<custom_image_name>
docker run -p 8080:8080 ishahroz/simple-dockerized-node-app
docker run -it <docker_hub_ID>/<custom_image_name> sh
docker run -it ishahroz/simple-dockerized-node-app sh
docker ps
Docker-compose makes it very easy for networking between containers since Docker maintains its internal hostname scheme between containers. It assumes docker-compose.yml file exists in the project directory.
docker-compose up
docker-compose up --build
docker-compose up -d
docker-compose down
It assumes your terminal is opened in the same directory as of docker-compose.yml file.
docker-compose ps