This repository contains wide variety of Docker examples and scenarios
docker build .
- to build the image with same contextdocker build -f <docker file path> .
- to build with different docker file name other than Dockerfiledocker build -t <dockerid/containername> .
- to tag the imagedocker run <containerid/tag image>
- to the run the docker imagedocker run -p "inport:outport" <containerid/tag image>
- to run the image with speciifc portdocker run <containerid/tag image> bash
- to override the startup command. Eg: bash here
docker-compose up
- to start the containerdocker-compose up --build
- to rebuild and start the appdocker-compose ps
- to list all the containersdocker-compose down
- to stop the containers
docker run -p 3000:3000 -v /app/node_modules -v $(pwd):/app <dockerid/containername>
- in this case use workdir volumes for node modules and current working directoty for other files.