Basic 🐋Dockerfile
Instructions 📿
Instructions 📿
Restart policies
Commands 👾
docker build -f docker_file_name
⇒ to build docker image from a custome file name.
docker run hello-world
⇒ to run docker image hello_world
docker ps
⇒ to list the running containers
docker logs container_id or contaner_name
⇒ to show the logs of container
docker attach container_id
⇒ attaches our terminal(STDIN, STDOUT, STDERR) to the container terminal(STDIN, STDOUT, STDERR);
docker exec -it <container_id> sh
⇒ to execute command inside container
docker run -it -v $(pwd):/app <Image_name> sh
⇒
- download <image_name>
- make current path as a volume for the container
- open shell inside the container
Commands Parameters
-p out:in
⇒ map the port outside of the container to port inside of the container
-t tag_name
⇒ to tag the current container to a fancy name instead of dirty container id